Can you view the actual SQL INSERT INTO that is generated from a Form?

I’m new to all of this so my terminology may be a little off.

I have a problem with my FORM when I’m trying to insert a new record. I’m getting an error from my MariaDB 10 db telling me that one of the foreign keys doesn’t have a default value. I understand what the error is telling me but I was hopping that if I could see the SQL that is being sent to server it might lead me down the correct path to getting the problem corrected. Is there a way to see the actual SQL that is being sent to the server?

The table that I’m trying to INSERT INTO, TRANSACTIONS, is a table that has a key, two foreign keys into two other tables, two VARCHAR and a DATE row.

Thanks.

I think I see a issue with my design. I’m thinking now that the Account Type needs to point to Account table and not the Transaction table.

Hello,

There is no easy method to see what is passed to the DB from a form as the DB will see it, especially if you are new to LO and or Base.

The error you state (certainly not clearly defined) does not make much sense. Posting the actual error may be of some help. Usually when dealing with foreign keys they are not defaulting to a value. They have a specific value as they are pointing to records in another table.

A direction to take is run an actual SQL Insert statement with the data used on the form. Do this from the main Base screen menu - Tools->SQL.... This may give you a better indicator of the problem.

Most times it is simply missing data or incorrectly assigned data to a control.

With continued problems, will need more specifics on the tables and forms.

Edit:

Seems what is need is a list box to select the key from the linked table.

The error message is [ma-3.1.9][10.3.21-MaraDB]Field ‘acctype_id_fk’ doesn’t have a default value

I know that it’s telling that i have to send the acctype_id_fk with the INSERT statement. That much I know. I just haven’t been able to figure out how to capture the fk. I’m sure that I can (could) compose a proper INSERT INTO statement and get a record into the db but that doesn’t really help me to understand what I’m doing wrong with the form.

The form is strictly only for submitting new data only, i.e. no editing, viewing or deleting existing entries. My intuition is that when I select an acctype, I need to capture it’s id and send that. I’m just not sure how to go about doing that.

https://drive.google.com/file/d/1oCmG

Not sure if that link will work for you but it’s a pic of the relationships in my database. I’m trying to submit a record into Transactions. It has to be madding trying to figure out this without knowing the structure of the db.

Thanks,

Initial reaction is your comment is correct. The account type has nothing to do with the transaction. It should be attached to the Account.

As noted in the edit of my answer, if it was to remain, it would simply be a list box selection. Select type then ID and type is displayed and ID is stored(bound field set to 1).