I want a query that asks for a value

  • Thread starter Thread starter Tedd
  • Start date Start date
T

Tedd

I would like to write a query that will ask me to enter a
value and then select data based on what I entered.
For example: I have a table that has an employee Name and
their SSN. I would want the query to ask me for the SSN
number and then bring back the employee that matches that
SSN.
There must be some way to say: SELECT Name FROM Table
WHERE SSN = what?. I am trying to do this in the
datasheet view in Criteria.
This should be easy but I can't get it to work.
 
Hi Tedd,

Try adding a parameter to the criteria in the SSN field
of your query. To do this, just enter a prompt
surrounded by []'s. For Example, type [EmployeeSSN] in
the criteria of the query. Any time the query is run, or
a form or report based on the query is run, Access will
generate a Dialog asking for the parameter value. After
you enter the value the query (or form or report) will
open as if that criteria had been typed in the query
design.

Hope that helps.

-Ted Allen
 
Back
Top