Linking a form to a query

  • Thread starter Thread starter Francesca
  • Start date Start date
F

Francesca

Hello,

I have created a form that has a drop down list of
employees.

What I would like is when you select an employee, and
select the command button "report" is to run the report
based on that employee. I have created a query but for
the employee # field I am not sure of what the code would
be for the criteria area. I know there will have to be
some code that will link the form to the query and then
the query will be used to build the report..

Would anyone know how to do this?

Thanks...
 
Base your report on a query something like:
SELECT *
FROM Assignment
WHERE PersonID = [Forms]![frmISRSelection].[cboAssignedTo];


The 2nd parameter is the name of the form and the third is
the name of the control on the form.
- David
 
Back
Top