In MS Acccess I have a column in my table that uses a drop down menu to select the value for the field, with six possible options. I am trying to make the same drop down menu/combo box in my form so that when a particular option from the list is selected it will filter my search query. I've made it to that point and works without a problem here.
However I want to have an option in the combo box that will say "Any" or "All" which will behave in a way that all records will be shown. Like when the combo box is initially blank when nothing is selected and the query shows all the records.
I have researched on the internet a few ways to do this, but I cannot get it to work properly.
I have added the UNION to my RowSource
query, which looks like this:
SELECT [testtable].[colourtype]
FROM [testtable]
UNION
SELECT "any"
FROM [testtable];
And I added this to my AfterUpdate
event:
If Me.ColourT = "Any" Then
strFilter = "*"
End If
What this does strangely is: it made my combo box list with blank values, there are six blank spaces (white) and no text.
EDIT: This is the code I have in my criteria for the query:
Like "*" & [Forms]![Search]![ColourT] & "*"
UNION
, are you getting the colour types in your ComboBox? – Ravindra Gullapalli