Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2003, 08:30 AM
Todd7 Todd7 is offline
Member
 
Join Date: Jan 2003
Posts: 42
Default Setting intial value in TDBLookupComboBox

How do I set the initial value in a TDBLookupComboBox?
I tried to set the file pointer in the underlying clientdataset for the ListSource to the record that I want displayed first (then the user can pick other records if they want). I used locate to move the current record pointer of the ListSource clientdataset, but the DBLookupComboBox is blank.

Thanks for any suggestions.
Reply With Quote
  #2  
Old 03-30-2003, 11:26 AM
Eddy-B Eddy-B is offline
Senior Member
 
Join Date: Feb 2002
Posts: 1,467
Default RE: Setting intial value in TDBLookupComboBox

hi,

moving the filepoiter of the nested dataset has no effect on your lookupcombobox.
what you need to do is set your 'default' value in your master dataset:

let's say i have 2 datasets:
dbMaster and dbLookup

dbMaster has 1 field (field1), and dbLookup has 2 fields (lookup, and value)
<tt><cb>
dbMaster dbLookup
field1 lookup value
... 1 one
2 two
3 three
</cb></tt>
now, let's assume we add a record to the dbMaster dataset.
Set the value of 'field1' to '1' to set it's default value.
This will automaticly show 'one' in any lookupcombo


let me know if you're having trouble with this;

regards,

Eddy-B

Please click <cr>Accept as answer</cr> if this helped</cr>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:48 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.