Link to home
Start Free TrialLog in
Avatar of Howie Lane
Howie Lane

asked on

ms access filter query with empty combobox

Hello,
I am quite new to Access. I am trying to create a GUI that allows user to search through the database. Currently the form (connected to a query connected to a report) I am working on has a Genus and a Year look up (both combo boxes). I would like the user to be able to select the genus and leave the Year combo box empty.
So for the the query of the Year field i have

WHERE [Year Published] = [Forms]![frmSearchGenusYear]![cboSearchYear] OR [Forms]![frmSearchGenusYear]![cboSearchYear] & "" = ""

When I leave the year combo box empty but select a genus the report runs everything.
How can I select the genus, leave the year blank to achieve all the years for that specific genus?
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

you are using the same combo box
SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Howie Lane
Howie Lane

ASKER

Thank you!
You are welcome :-)