Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


TDBLookUpComboBox Shadowing

Posted on 2003-02-25
Medium Priority
Last Modified: 2010-08-05
Hi there, looking for help from you Delphi gurus out there.

I have 2 TDBLookUpComboBoxes that both point to the same table and same database.  I would like it that if I click and choose a record in the 1st lookupcombobox that maps to a field in the table e.g a customer number then the 2nd combobox will change automatically to display that customer's name and vice versa i.e. if I choose a customer's name in the 2nd combo then the 1st should change to show his/her customer number.

I know that both these fields can be displayed and combined within the same lookupcombo using the ';' operator in the LookupDisplay property but for certain reasons I'd like to do it this way.

I've tried everything but when I change the 1st LookUpCombo, the 2nd one doesn't change and vice versa.  Funnily enough, when I use a TDBLookUpListBox control rather than a combo (using the tableindex number in the keyfield property), it works fine and both change to map each other's choices but I need a combobox and the lookupcombo doesn't seem to have a keyfield property like the listbox.

Can anyone help?

Many Thanks
Question by:rodski
  • 2
LVL 27

Accepted Solution

kretzschmar earned 240 total points
ID: 8017068
modify the keyvalue of the other lookupcombo,
to the keyvalue you have in the current lookupcombo

meikl ;-)

Author Comment

ID: 8017912
Wow, that does the trick.  Thanks Meikl for your quick response - you get the points (which I've increased to 60).  I can almost feel the frustration flowing out of my body...

LVL 27

Expert Comment

ID: 8019080
glad to helped you, rod,
good luck again

meikl ;-)

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Loops Section Overview
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

569 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