Form Filter (1 Viewer)

rohanmalhotra83

Registered User.
Local time
Yesterday, 23:31
Joined
Jul 26, 2010
Messages
16
Hi all

I have a form which has 3 comboboxes. What i am looking to do is to filter the combobox based on other. That is, when the user select an option from first combobox, the options in below combobox filters and accordingly and when an option is selected in second combobox, the options in third combobox is filtered accordingly.

I know its bit complicated, however, if anyone could help it would be great.

Thanks in advance.
Rohan
 

Yarp

Registered User.
Local time
Today, 07:31
Joined
Sep 16, 2009
Messages
51
I figured this one out myself recently, so there may be a better way, but this is how I did it.

Basically you need to enter a valid query into the 'Row Source' on the combobox2 properties. I assume you have already done this combobox1. You can either create a query and call that, or just plug the SQL into the 'Row Source'.

Next I created some VBA for the 'After Update' Event on combobox1. This VBA is (for example)
Code:
me.combobox2.requery
.

Each time you change the selection in combobox1, your options should change in combobox2. Without knowing your level of knowledge, it is harder to go into further details. Just post back if you have any questions.
 

rohanmalhotra83

Registered User.
Local time
Yesterday, 23:31
Joined
Jul 26, 2010
Messages
16
Thanks for this... it was really helpful. However, could you please tell me if i want add this data to a table, how that can be done?
 

vbaInet

AWF VIP
Local time
Today, 07:31
Joined
Jan 22, 2010
Messages
26,374
You use a form and put it in the After Update event of the combo box. Have a look at the tutorial again.
 

Users who are viewing this thread

Top Bottom