String Parameter Query In MS Access

How We Pass String parameter in MS Access Query

In this tutorial we discus that how we pass string parameters to access the record form Access database. For example if we have a table which contain four filed as given below:

String Parameters in Access

From the above table if we want to display the record which have SNAME is Ali Shah. for this purpose we use simple query with String parameters.

For example

we just pass parameters in criteria [Enter the Name]

string parameters in Access
After passing these parameters when we run this a dialog box appear which is asking for Enter the Name for example we enter the name as "Ali" then in the result nothing will be display means zero record will be display because we not mention any operator then by default operator is Equal To " = " . Equal to means that Whole String is Same as Our Parameter So there is no name which is equal to Ali in our Above table.

Now if we pass the following string parameter:

string parameter in access

Like " * " & [ Enter The Name] & "*"

In this Above query we use Like operator with  Star * wild card. Which means given parameter match with any part of string and if our parameter is match any part of the full string then it will be return.

So if we enter Ali as our parameter then it will be match with three record as part of string

Ali Shah

Muhammad Ali

Ali Khan

All above name Contain Ali So the result is:

String parameter Query