Dmitry,
I had tried that, this is why it was so confusing. You have to have it on both OnFormShow event and on the OnChange event or it will not work. It must be in both places.
Just OnShow will not allow selection of the DBFile box at all.
Just OnChange will allow you select it no matter what.
Using both together gets me the result that I need.
So it must be like this to work
procedure add_file_ComboBox2_OnChange (Sender: TObject);
begin
if add_file.ComboBox2.dbItemID = -1 then add_file.DBFile1.Enabled := False else add_file.DBFile1.Enabled := True;
end;
procedure add_file_OnShow (Sender: TObject; Action: string);
begin
if add_file.ComboBox2.dbItemID = -1 then add_file.DBFile1.Enabled := False else add_file.DBFile1.Enabled := True;
end;
Thanks
Thanks to you too ehwagner. The research really helps, sometimes I find stuff by accident that way.
Sonny.