combo box selection

Badswell

Registered User.
Local time
Today, 13:22
Joined
Feb 13, 2004
Messages
34
I have a query that runs off of a specific product category through a combo box on a form.

(((Item_Detail.Product_Category)=[Forms]![category_summary]![cat_name_combo]))

The first option in the combo box is an empty entry that returns no results since it is not tied to any category.
The combo currently looks like:

------------------
Combo Box
------------------

Curtains
Helmets
Soldering



On a seperate form, this query is also run to show information on the entire program and not specific to just 1 cateogory.

Is there a way to create an entry in the combo box (preferably the default option that would run the query for the entire program and if the combo box was expanded, then a specific category could be selected?

------------------
Combo Box
------------------
All Categories
Curtains
Helmets
Soldering
 
There may be a better way to do it, but the first thing that springs to mind is to have two queries...one with the combo box criteria and one without. Set the combo box to default to the value "All Categoies". Then, make a button to run the query with an IF statement (BTW, I suck at code so this is not correct syntax):

IF me.cat_name_combo = "All Categories" THEN
docmd.openquery(query without criteria)
ELSE
docmd.openquery(query that uses combo box value as criteria)
 
Article ID: Q128881
 

Users who are viewing this thread

Back
Top Bottom