Link to home
Start Free TrialLog in
Avatar of fabyola
fabyola

asked on

Help - DBLookUpComboBox

I have a DBLookUpComboBox for the user to navigate through a DataSet but I didn´t assign a DataSource and a DataField to it because I don´t want it to post anything so I just assigned the ListSource, ListField and KeyField to show. But what I need to do is that when the user opens that form, I need  DBLookUpComboBox to show the first record on the DataSet and it´s showing me Blank.
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image


  1) remove the field value from the dataset

  procedure TForm1.ADOQuery2BeforePost(DataSet: TDataSet);
  begin
    with DBLookupComboBox1 do
      DataSource.DataSet.FieldByName(DataField).Value := null;
  end;

  2) add 2 additional components - DataSource and DataSet (Query, etc) where you are not performing Post operation
Avatar of fabyola
fabyola

ASKER

Didn´t work. I want to do it without having to put a DataSet and assigning a DataSource and DataField to my DBLookUpComboBox.
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial