Solved

Help - DBLookUpComboBox

Posted on 2004-04-23
3
405 Views
Last Modified: 2010-04-16
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.
0
Comment
Question by:fabyola
3 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10899190

  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
 

Author Comment

by:fabyola
ID: 10899335
Didn´t work. I want to do it without having to put a DataSet and assigning a DataSource and DataField to my DBLookUpComboBox.
0
 
LVL 17

Accepted Solution

by:
mokule earned 50 total points
ID: 10899566

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

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Working with hours 3 65
How to renew a Delphi rad-studio licence? 5 69
Why can't I create any project with my delphi EXE file? 6 39
Delphi Yen format 3 45
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question