You can take a look at parameter queries.
You can also take a look at using a form to feed the parameter values to the query.
You can also use VBA to build the entire SQL string.
Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm
A brief quote from an John Vinson (Access MVP) posting on using a form to set
parameter values with a combobox.
You'll need to create a small unbound Form (let's call it frmCriteria) with a
Combo Box control (cboCrit) on it. Use the combo box wizard to select the table
for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.
Now use
=[Forms]![frmCriteria]![cboCrit]
as the criterion in your Query.
It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form or
report, the user can enter the criterion and view the results in one simple operation!
Quoting John Vinson
Keywords: Parameter Queries