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
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

764 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