John Wolfenstein
John Wolfenstein

Reputation: 141

Access Query Parameter Filtering Form

I am filtering a form named sfrWorklistFilter from a combo box named cboOpeningType. The recordsource is from an embedded query on the form. If I make a selection from the combo box the filter works fine with the following code:

Forms![sfrWorklistFilter]![cboOpeningType]

However I need to return all records when no selection is made in which case I use the following code:

Like Forms![sfrWorklistFilter]![cboOpeningType]  & "*"

The filter then does not give exact matches, but all records that begin with the letter on the combo box.

I need exact matches for the record or if no selection is made all records.

Any suggestions?

Upvotes: 1

Views: 85

Answers (1)

dbmitch
dbmitch

Reputation: 5386

EDIT remove double quotes

This should work - and you can do same thing with your other field/combobox searches

Like IIf([Forms]![sfrWorklistFilter]![cboOpeningType]<>"",[Forms]![sfrWorklistFilter]![cboOpeningType],"*")

Upvotes: 1

Related Questions