View Full Version : Combo Box synchronization


George Delaware
04-07-2002, 11:25 PM
Hi, I know there have been a number of posts regarding this, but I've tried many methods and nothing is working for me.

I am using the Order Entry database that comes with ms access. The wizard generates all the relationships etc.

I've tried http://support.microsoft.com/support/kb/articles/Q209/5/76.ASP?LN=EN-US&SD=gn&FR=0&qry=q209576&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000

and it does not work with the Order Entry db. I've tried countless times. I was wondering if anyone could either test it or help me to get this thing working. I've been at it for quite some time now.

when i enter the code provided by the above link, when i choose the second drop down box, it displays everything. Not what just corresponds to box number one.

I am making a sample db for a restaurant. So when you choose Beef, all the beef dishes should appear in the second drop down box. Problem is, is that it doesn't. http://www.access-programmers.co.uk/ubb/smile.gif

All of the menu items appear.

Does anyone know what I'm doing wrong? Thanks very much!

-George

Rich
04-07-2002, 11:47 PM
"Solutions" sample db has examples of sychronized combo boxes.

Pat Hartman
04-08-2002, 07:12 PM
There are two things that you need to do to synchronize two comboboxes. In the query for combo2, refer to combo1 as selection criteria:

Where SomeField = Forms!YourFormName!YourCombo1Name;

And in the AfterUpdate event of combo1, you need to requery combo2 to get it to refresh.

Me.YourCombo2Name.Requery

George Delaware
04-09-2002, 03:54 AM
Thanks for replying.

I've tried that, however I choose Combo Box number one, and then when I go to Combo Box number 2, it is blank.

i've double checked the names to make sure they match, and the queries.
??

Fizzio
04-09-2002, 04:14 AM
Make sure that you are putting the criteria in the correct field. Generally speaking, the value of a combo is the first (normally hidden) column. This is normally an ID. Check the recordsource of the first combo (if it is a query, check which is the first shown field - this is the value of your combo)
make the sure the criteria for the field you want to filter is =Forms!YourFormName!YourCombo1Name

HTH

George Delaware
04-10-2002, 11:45 AM
I was using access xp. So i decided to try the microsoft tutorial in Access 2000, which was similar to your guys' suggestions.

It worked!Thanks for all your help.

alexlancaster
08-04-2005, 10:10 PM
Hi!

I'm currently developing a restaurant project, and I'm running into the same trouble you did. How did you solve it? I'd highly appreciate a sample db!
thanks!!

Pat Hartman
08-05-2005, 10:32 AM
Follow the directions I posted. Cascading the combos requires only two things. Look at the northwind or orders sample databases that shipped with your version of Access for an example.