Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Forms

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-20-2008, 05:46 AM
Novice
 
Join Date: Apr 2008
Location: Bethpage, NY
Posts: 4
GeorgeD is on a distinguished road
Send a message via Yahoo to GeorgeD
Default A combo box question

I've got a table with customer name fields (last name, first name) and I want to use a combo box on a form to search for and retrieve a specific customer.

I have several customers with the same last name, but who are differentiated by their first names.

I set up my combo box based on a query using the last name as the bound column but displaying both last and first names. Now I can get to the first name record fine, but the control will not allow me to select any other common last name in the set. I can select a different last name and it's fine. Is there some magic here I'm missing?

Well, being pressed for a solution and not finding one I set up synchronized combo boxes, one for last name and one for first name. This seems to do the job, although in a clunky manner.

If I'm forced to use the synchronized approach is there any way to get rid of the duplicate names which show up based on the search argument and still have all the associated first names show in the second combo box?

I'm sure there is a simple solution to this problem. I can't believe that nobody has run into this before. All the examples I've managed to find use two related table such as a categories table and items table. These examples provided the synchronized combo box solution but don't solve my problem.

I could really use some help on this, even thought it's a very elementary situation. TIA.
Reply With Quote
  #2  
Old 05-05-2008, 07:05 AM
Novice
 
Join Date: May 2008
Posts: 9
protean_being is on a distinguished road
Default

Using proper database design you should have a customer name ID field that is a primary key. The combo box's fields would then be ID, LastName, FirstName. Hide the ID column by making column widths be 0"; 1"; 1". The bound column is 1. This will link to the customer name and remove the issue of two customers with the same first and last name. The ID should be used in any other tables that the customer name is used in. Use a query to get the FirstName and LastName. This way is the customer changes their name (ie marriage) then you can change it in one location.
Reply With Quote
  #3  
Old 05-05-2008, 08:46 AM
Novice
 
Join Date: Apr 2008
Location: Bethpage, NY
Posts: 4
GeorgeD is on a distinguished road
Send a message via Yahoo to GeorgeD
Default

Thank you for the pointer. I think my problem stemmed from the in house customer id being composed of 3 variable sections. Trying to use a multi-field primary key caused me even more problems. Using your suggestion the problem was easily solved by using an internal "customer id" to tie all the relevant information together. Thank you for the assistance.
Reply With Quote
  #4  
Old 05-05-2008, 08:53 AM
Novice
 
Join Date: May 2008
Posts: 9
protean_being is on a distinguished road
Default

No problem. If you want to learn more about how to set up a table, look for a database book that explains Normalization. This will help you understand better table design.
Reply With Quote
Reply

Bookmarks

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
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering subform combo from main form combo MUKUDU99 Forms 0 08-17-2008 10:19 AM


All times are GMT -8. The time now is 02:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.