Topic: How Reverse Show Data form edit.text To combobox.dbItemID+parent
My lesson i don't record in table is id(number) but record text(TA,TB)
for easy print or report design
Step 1 Script to record from combobox.dbItemID to edit.text
//send data combobox.dbitemid to edit.text
procedure summary_editor_ComboBox1_OnChange (Sender: string);
begin
summary_editor.Edit1.Text :=
SQLExecute(
'select table_a.TA from table_a where table_a.id ='+
inttostr(summary_editor.ComboBox1.dbItemID));
summary_editor.Edit2.Text :=
SQLExecute(
'select table_b.TB from table_b where table_b.id ='+
inttostr(summary_editor.ComboBox2.dbItemID));
end;
procedure summary_editor_ComboBox2_OnChange (Sender: string);
begin
summary_editor.Edit1.Text :=
SQLExecute(
'select table_a.TA from table_a where table_a.id ='+
inttostr(summary_editor.ComboBox1.dbItemID));
summary_editor.Edit2.Text :=
SQLExecute(
'select table_b.TB from table_b where table_b.id ='+
inttostr(summary_editor.ComboBox2.dbItemID));
end;
--- It OK No error
Step 2 I want to show data form edit.text To combobox.dbItemID when edit
but combobox have parent it display combobox1 only
//reverse show edit.text to combobox.dbitemid
procedure summary_editor_OnShow (Sender: string; Action: string);
begin
summary_editor.ComboBox1.dbItemID :=
SQLExecute(
'select table_a.id from table_a where table_a.TA ="'+
(summary_editor.Edit1.Text)+'"');
summary_editor.ComboBox2.dbItemID :=
SQLExecute(
'select table_b.id from table_b where table_b.TB ="'+
(summary_editor.Edit2.Text)+'"');
end;
why combobox2 no show ?
help me please !
Easy For Beginner Student For Me