Topic: Query to save record

I have a form of which pic attached. It contains Text box and two combo box shown in pic. I want to save data which is textbox and combobox by clicking button save using query to another table.

Post's attachments

Attachment icon Screenshot 2022-01-09 202523.png 6.06 kb, 94 downloads since 2022-01-09 

2 (edited by sparrow 2022-01-09 19:37:36)

Re: Query to save record

Hi,
create an OnAfterClick event for the record button.
In the script in the OnAfterClick event write

SQLExecute('INSERT INTO table (column1,column2) VALUES( value1, value2);

Where:
Column1, Column2 - Columns in your table,
value1, value2 - Data from TextBox and ComboBox in the format you need.

Re: Query to save record

Thank you sparrow. In my attached screen short, there are three different tables name, class and grade and they have same columns name, class and grade. How would I get value from combobox and text box?. Can you write complete query?

4 (edited by sparrow 2022-01-10 08:32:18)

Re: Query to save record

You can read it here:

Component EDIT - http://myvisualdatabase.com/help_en/script_edit.html (pay attention to sqlValue with example)
Component ComboBox - http://myvisualdatabase.com/help_en/ComboBox.html  (pay attention to sqlValue with example or Text)

Do not hesitate to read.