Query Wildcard for Primary Keys

DeanFran

Registered User.
Local time
Yesterday, 21:38
Joined
Jan 10, 2014
Messages
111
I'm in the process of building a record filtering query tied to a search form. I've only done this once before, and I used the actual text (aka Name) rather than the Primary key for the search criteria, so I was able to get away with using a combo box and this in the query criteria
Code:
Like "*" & Form!frmSomeFormName!cboListOfThings &"*"
so that no selection returns all. Of course when you do that, and choose the Item with the primary key number of 1, you also get 10, 11, 12, 21, 31, etc. This is probably pretty basic, but how does one limit the query to only return the result for 1, AND return All if no selection is made in this case?
 
Last edited:
Stumbled upon this, and it seems to work. Am I on the right track?
Code:
Forms!frmSomeFormName!cboListOfThings OR Forms!frmSomeName!cboListOfThings Is Null
 

Users who are viewing this thread

Back
Top Bottom