Expression for Criteria for Form with Combo Boxes

B

Basenji

Using Access 2003 I have a form with combo boxes for selecting criteria for a
query. I would like for the user to be able to select a specific critieria
from the combo box list or hit enter for all. I have the following expression
in the criteria row for the location field,
Like [Forms]![frmLocaDatePhyProc]![CLocation] & "*"
for the procedure field
Like [Forms]![frmLocaDatePhyProc]![CProcedure] & "*"
The enter key for all works fine but when a specific criteria is entered for
one of the combo boxes, there are no records returned.
What do I need to do differently?
 
G

ghetto_banjo

if no criteria is selected, is the combo box Null?

if so, you could use this:

Like NZ([Forms]![frmLocaDatePhyProc].[CLocation], "*")


Note to use use ! after Forms and just a period after the form name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top