?
Solved

dblookupcombo display value

Posted on 2005-03-02
7
Medium Priority
?
196 Views
Last Modified: 2010-05-18
My dblookupcombo when it shows is empty.How can I have it display a record
when it shows?
0
Comment
Question by:srbenavrbe
[X]
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
  • 2
  • 2
7 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 13445239

You should set KeyValue

mokule
0
 
LVL 11

Expert Comment

by:calinutz
ID: 13445469
In the DBLookUpComboBox you must set the properties ListSource to the DataSet ythat you want to display, then the Listfield to the field that you want displayed and then the keyfield to the field that you want to use (without showing it).
For example if your table contains agents that have a name <<name>>, and an unique code <<code>> then
If you want to use the code for your coding purposes not the name but the code is not relevant for the user then assign the keyvalue to the code field and the listvalue to the name field.
Cheers
0
 
LVL 11

Expert Comment

by:calinutz
ID: 13445566
So you can use 2 fields from the same record using the DBLookUpComboBox. One you can use to show it to the user and in the background you can use the other for your coding purposes. If you need anymore help just ask.
Cheers
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:srbenavrbe
ID: 13445900
It is not problem linking to datasource but there is no value visible
when it shows.I I would like a value showing.
(For classic combo you would set its itemindex to 0 or 1..)
0
 
LVL 17

Expert Comment

by:mokule
ID: 13445963
I've already answered.

You should set KeyValue
0
 

Author Comment

by:srbenavrbe
ID: 13446068
mokule,can you tell me how and where?
new to this...
0
 
LVL 11

Accepted Solution

by:
calinutz earned 200 total points
ID: 13447367
In designtime you mean?
In runtime all you need is to set the propertyes as I specified above and if you don't get your value shown then perhaps you should place this in your prefered event (AfterOpen, FormShow etc.):

DBLookUpComboBox1.KeyValue:=AdoQuery1.FieldValues['agent'];
where AdoQuery1.FieldValues['agent'] should point to the keyField assigned in the keyfield property of the DBLookUpComboBox

It works for me
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

777 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