How do I put a "Lookup" field in a query?

S

sfa

I have a query that looks up info based on a first name. Right now when I
run the query, a box opens asking "Type Employee First Name". I want a
"lookup" box to pop up so users can click the drop down button and choose the
employee name.
 
D

Duane Hookom

Parameter prompts in queries are very limited and should be used very
sparingly if ever. Use controls on forms for all entry of criteria. This
allows you to select values from combo boxes and other controls.
 
J

John Vinson

I have a query that looks up info based on a first name. Right now when I
run the query, a box opens asking "Type Employee First Name". I want a
"lookup" box to pop up so users can click the drop down button and choose the
employee name.

Use a Form to solicit the criteria.

Create a small unbound Form, frmCrit let's say, with an unbound combo
box cboEmployee; this should display the employee names, and have the
unique EmployeeID as its bound column (I *hope* you're not looking up
every employee who is named John or Kathy!)

Use a criterion in your query of

=Forms![frmCrit]![cboEmployee]


John W. Vinson[MVP]
 
D

dtoney

Can you go one step further? If I do a lookup form, how do I bring up the
record on the data entry form? My app is for employees & I need to update
their insurance information. I would like a lookup form so when I need a
certain record, it comes up. If there is no existing record, bring up a
blank form.
Any ideas?

John Vinson said:
I have a query that looks up info based on a first name. Right now when I
run the query, a box opens asking "Type Employee First Name". I want a
"lookup" box to pop up so users can click the drop down button and choose the
employee name.

Use a Form to solicit the criteria.

Create a small unbound Form, frmCrit let's say, with an unbound combo
box cboEmployee; this should display the employee names, and have the
unique EmployeeID as its bound column (I *hope* you're not looking up
every employee who is named John or Kathy!)

Use a criterion in your query of

=Forms![frmCrit]![cboEmployee]


John W. Vinson[MVP]
 
Top