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.
fabyolaAsked:
Who is Participating?
 
mokuleConnect With a Mentor Commented:

  Table1.First;
  DBLookupComboBox1.KeyValue := Table1.FieldByName('xxx').Value;
0
 
Ivanov_GCommented:

  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
0
 
fabyolaAuthor Commented:
Didn´t work. I want to do it without having to put a DataSet and assigning a DataSource and DataField to my DBLookUpComboBox.
0
All Courses

From novice to tech pro — start learning today.