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;