[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


DBLookupComboBox - Refresh

Posted on 1999-01-10
Medium Priority
Last Modified: 2008-03-17
How do I get a DBLookupComboBox to show the first record of the listsource when the Table is activated.

I've tried Table1.first but the dropdown still remains blank until I have first selected an Item.

If I have a parent table a select a record the I want the dropdown to now refresh and show the new detail records as per master table record.
Question by:smithsj1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 1355683
Try to set the keyvalue to a value that is significant to your setting in keyfield.
You can try to set
DBLookupComboBox.Keyvalue:="firstvalue in table"


Author Comment

ID: 1355684
Samone do you mean


Why doesn't Inprise just default th lookup to show the first record.

Expert Comment

ID: 1355685
Open the 'listsource' table before the table that use the value from listsource.

Table1.open; <---- Table that has a listsource
Table2.open; <---- Table that use a listsource value.

if you entering the correct value in DBLookupComboBox property then everything must be ok as expected.

But if you still insist that you have to open the table that contain listsource open after the second table than you must add this code :

procedure TForm1.Table2NewRecord(DataSet: TDataSet);
    Table2ID.AsInteger := 1; // i assume that the first value of table1 is 1

Inprise did make Dblookupcombobox show the first record.

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 1355686

Samone already answered the Q to my satisfaction.

Expert Comment

ID: 1355687
Why did you reject my answer then?

Author Comment

ID: 1355688

I needed to confirm what you meant.

"Samone do you mean "

"dblookupcombobox1.keyvalue:=table1.findfield('name').asstring; "

" Why doesn't Inprise just default th lookup to show the first record."

Submit your answer again I'll accept it now!

Accepted Solution

samone earned 200 total points
ID: 1355689
Yes if you have a stringvalue as keyfield its ok.
And if you know of a string that you always got at the top you only need to set DBLookupComboBox1.KeyValue:='Firstrecord';
But I rather use a index of integers in the first field in the database.

Like if I have a TABLE 'table1' with the fields
1      BILL
2      JOHN
3      CHARLES

I use the index field as a keyfield and name as listfield
You set the DBLCB text field like this.


If you don't want to create the index numbers by yourself
you can use autoincrement (if you don't use Dbase).


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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