Solved

Help - DBLookUpComboBox

Posted on 2004-04-23
3
401 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now