Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Question - Refine with Criteria or Pull all records?

Status
Not open for further replies.

jmgibson

Technical User
Oct 1, 2002
81
US
I have a very simple query that allows a user to pull up an employee's information by their empID.

SELECT tblEmployee.empID, tblEmployee.Name
FROM tblEmployee
WHERE (((tblEmployee.empID)=[Enter empID to list Specific Employee]));

I also would like the ability to pull all employees if the ID is not known (ideally through the same query). For instance, when the query runs, the pop-up box would ask a user for the empID, but if they left it blank, it would pull all data. Any thoughts?
 
I would use a form where the user could select the employee(s) they want included in the query via a single or muli-select listbox or combobox. If nothing is selected, then all would be displayed. I just explained how to do this for someone else in this thread thread702-1030820
 
Is there a way to do this with an IIF statement instead?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top