Parameters

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I am coming from SQL environment and I am trying to remember how to specify
a query with a parameter.

When I build the query in Access, how do I identify a parameter value is
required and where it is required? If I had a query like the following,
how would I identify the paramters ( I put ?? where I want to pass the
parameter from a program?).

Select UserName, UserPassword
where UserName = ??
 
I am coming from SQL environment and I am trying to remember how to specify
a query with a parameter.

When I build the query in Access, how do I identify a parameter value is
required and where it is required? If I had a query like the following,
how would I identify the paramters ( I put ?? where I want to pass the
parameter from a program?).

Select UserName, UserPassword
where UserName = ??

To prompt the user with a popup box:

Where UserName = [Enter name:]

When using a Form control as a parameter (often preferable), use

Where UserName = [Forms]![yourform]![controlname]
 
I am coming from SQL environment and I am trying to remember how to specify
a query with a parameter.

When I build the query in Access, how do I identify a parameter value is
required and where it is required? If I had a query like the following,
how would I identify the paramters ( I put ?? where I want to pass the
parameter from a program?).

Select UserName, UserPassword
where UserName = ??

Jim,
Place the parameter within brackets.

Where UserName = [Enter the name]
If you enter Smith, only UserNames that exactly match Smith will be
returned.

or, to be able to enter a partial name you can use the * as a
wildcard.

Where UserName Like [Enter part of the name] & "*"
If you enter Smi, you will get all records that start with Smi, i.e.
Smithsonian, Smithers, Smith, etc.

or..
Where UserName Like "*" & [Enter part of the name] & "*"
If you enter Smi, you will get records that have Smi anywhere in the
field, Smithers, Hammersmith, Cosmipolitan, etc.
 
Back
Top