Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox - Can I filter the selections?

Status
Not open for further replies.

sazi22

Technical User
Oct 7, 2004
43
US
I want the selections in combo box "B" to change based on what the user selects in combo box "A." Do I use a filter for this? I've tried using the ApplyFilter method referencing a query, but I get an error saying that the field can't be found.

I know there has to be a pretty simple way to do this... Can someone please help me?

Thanks.
sazi
 
Simply build on the fly the comboB.RowSource property in the AfterUpdate event procedure of comboA.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This helps. I'll try it... THANK YOU!
 
Is this the right code to be using?

If cmbA = "abc" Then
DoCmd.ApplyFilter ([qryActivitiesabc])
Else
If cmbA= "def" Then
DoCmd.ApplyFilter (["qryActivitiesdef"])

Thank you.
 
What is the underlaying SQL code of the RowSource property of cmbB ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
There isn't any that I know of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top