Using Like criteria in a Parameter Query

pgmadhav

Registered User.
Local time
Today, 11:39
Joined
Aug 9, 2013
Messages
14
Using Like criteria in a Parameter Query
It is possible to create a parameter query in Access that will search for records that match the parameter entered by the user AND contain all other records that have that value plus other text.

For instance you may want Access to return all records that begin with the letter Q.

To do this you need to enter the following expression into the criteria row:

Like [Find records beginning with:] & "*" Or Is Null

The user can enter a Q and the criteria concatenates the wildcard character * to this parameter value, to find all text strings that begin with a Q.

By also using Or Is Null in the criteria the user can enter a blank value into the parameter query to return all records, even if this field is blank.

But how do I search if i want all the records with John anywhere in the field???
 
Try

Like [Find records beginning with:] & "*" Or Is Null and
Like "*" & [Find records containing:] & "*" Or Is Null

Brian
 
You need to repeat the operand with the "or Is Null"

Where SomeField Like "*" & [Find records containing:] & "*" Or SomeField Is Null
 
I want to actually give input to the query from a dialog box(FORM I mean )
 
I misunderstood your first requirement I thought that you wanted both options, to reference the form code


Where SomeField Like "*" & Forms!yourformname!yourtextboxname & "*" Or SomeField Is Null

Brian
 

Users who are viewing this thread

Back
Top Bottom