There is a form1 in which a table from the database (access) (there are four tables in the database). Hooked to the database via ADOConnection1 When I click the "Add" button, form 2 pops up where I set the data in the table using DBedit and DBCombobox via ADOquery1 and Datasource1. And everything works, but I added another button in front of the combo box that opens form3 in which another table from the same database, where everything is made as for the principle1. Adoquery2 and Datasource2 are form3, there is another ADOconnection1. Now, if I run the program, form1 opens and when I click the add button, it writes a subject. What did you do wrong?

Form Code1:

procedure TForm1.BitBtn1Click(Sender: TObject); begin Form2.show; Adoquery1.insert; end; procedure TForm1.BitBtn2Click(Sender: TObject); begin form2.show; end; procedure TForm1.BitBtn3Click(Sender: TObject); begin Adoquery1.delete; end; 

Form code2:

 procedure TForm2.BitBtn1Click(Sender: TObject); begin Form1.ADOquaery1.edit; close; end; procedure TForm2.BitBtn2Click(Sender: TObject); begin Form2.close; end; procedure TForm2.BitBtn3Click(Sender: TObject); *кнопка добавить* begin Form3.show; end; 

Form code3:

 procedure TForm3.BitBtn1Click(Sender: TObject); begin Form4.show; Form3.ADOquery1.insert; end; procedure TForm3.BitBtn2Click(Sender: TObject); begin form4.show; end; procedure TForm3.BitBtn3Click(Sender: TObject); begin form3.adoquery1.delete; end; 

    1 answer 1

    Format the code correctly, otherwise it is impossible to read.

    You most likely do not have ADOConnection connected. Do you make him ADOConnection: = true ?

    • While waiting for an answer already figured it out thanks. Now the problem is as follows. When you open the second table, I press the "add" button and form 4 comes out where you need to enter data into the second table. I enter the data I click ok, but there is no data in the table. code on the button Form3.ADOquery1.edit; close; Why data is not recorded? - acid_sem