Using a form to enter criteria

  • Thread starter Thread starter Jamie Dickerson
  • Start date Start date
J

Jamie Dickerson

I have a report that is based off of 3 different queries. Right now I
manually enter the filter criteria (employee ID) into the queries prior to
printing the reports. I would like to creat a form that asks for the
employee ID (only once) then moves the information to all 3 queries, after
criteria is entered the report will print. I have had trouble getting the
form to move the criteria to all the queries, the only solution I came up
with is to enter it 3 times. Any help or suggestions is appreciated.

Thank You in Advance

Jamie
 
Create the form with unbound text box. In the queries use this as criteria --
[Forms]![YourFormName]![TextBoxName]
The form must have the information and stay open when running the report.
 
Assume your form name is frmEmp, the control on the form is txtEmpID

In the query it would be
WHERE [EmpID] = [Forms]![frmEmp]![txtEmpID]
 
You don't 'move the information to all 3 queries'.
Instead the query refers to the control on the form e.g.
Forms!MyCriteriaform!MyEmployeeIdcontrol
Provided the form is open when the queries run, the reference should be
resolved.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
Back
Top