Topic: Need Help

Anyone can mention error in following statement which is not executing and showing  error on Text;
     
          SQLExecute('INSERT INTO `Sal` (`books`)'):= form2.ComboBox2.Text;

Re: Need Help

SQLExecute(INSERT INTO sal (books) VALUES ("'+form2.ComboBox2.Text+'")');
On a clear disk you can seek forever

Re: Need Help

Hi CDB,
           This statement does not  work. In fact I want  to save a combobox text to another field of a table. In this statement books is a field and sal is a table. How it can be? Thanks.

4 (edited by CDB 2020-12-06 03:18:09)

Re: Need Help

Unforgettable,

Sorry I led you down the wrong path.  I hadn't realised it wasn't working properly until the other day.


I've just discovered that combobox.text  only works if you fill an edittbox with the combox text and then use the editbox in your SQL statement.

Make the editbox invisible.


So  place the code in the ONChange event.

Form2.edit1.text := Form2.combobox1.text;
SQLExecute(INSERT INTO sal (books) VALUES ("'+form2.Edit1.Text+'")');
On a clear disk you can seek forever

Re: Need Help

Thank you to reply CDB