Making selection from one combo box determine options possible in another combo box?

robjones23

Registered User.
Local time
Today, 06:33
Joined
Dec 16, 2004
Messages
66
Hi,

I've got a form with two combo boxes. What i want is for the selection within combo box 1 to determine the selections available from combo box 2. I can get it to work on the first instance, i.e. when the form is initially ran, however if the selection of combo box 1 changes, the selections available in combo box 2 remain the same.

In other words, i need to know how to get it to "refresh" every time a new option is selected within combo box 1.

I'm using the following code at the moment:

SELECT DISTINCT [Report Linked].[Item*] FROM [Report Linked] WHERE [Report Linked].[Category*]=[Combo16];

Combo box names aren't very helpful (my fault) - Combo box 1 is called "combo16" and combo box 2 is called "combo31"

I was thinkning that i need to put something into the on got focus / on lost focus but don't know what to put in.... or even if that's what i need to be doing :)

Help me!!!

Cheers,

Rob.
 
check out sample database forum, there are a couple in there...that do what your after
 
Thanks PArso, managed to find one.

for those that are interested, the answer was to add:

Private Sub combo16_Change()
Me.Combo31.Requery
End Sub

This re-runs the query whenever combo16 changes.... cheers all.
 

Users who are viewing this thread

Back
Top Bottom