Hi,
I'm currently creating a search function using two combo boxes, let's call them x and y. I want the user to be able to select a value from x and y and search, but also to be able to select one from x and leave y blank (thus retrieving all records), and vice versa, so selecting a value from y and leaving x blank.
I am using a query to perform this function and have worked out how to link this to the combo boxes using [forms]![formname]![comboboxname]. What I can't work out is what code to use to allow the field to be left blank. I have tried the following:
Like "*" & [forms]![formname]![comboboxname] & "*"
but I have now come to learn that this is just using a wildcard which is retrieving unrelated records (but which have some sort of commonality, such as a few similar letters).
If anyone can suggest what code to use to allow both a blank value and a selected value that would be amazing!!
Thank you
Phil