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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
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]
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top