I creating a VBA sub routine to output a report to PDF to each of the main supervisors. There are 10 supervisors in a query "qrySupv" which I want to use as a recordset. The query has one field "Supervisor" with 10 records.
The report is using the following query to create the data:
SELECT dbo_vw_ActiveEmployeeList.Supervisor, dbo_vw_ActiveEmployeeList.DeptID, dbo_vw_ActiveEmployeeList.DeptName, dbo_vw_ActiveEmployeeList.JobCodeID, dbo_vw_ActiveEmployeeList.PositName, dbo_vw_ActiveEmployeeList.LastName, dbo_vw_ActiveEmployeeList.FirstName, dbo_vw_ActiveEmployeeList.EmployeeID, dbo_vw_ActiveEmployeeList.EmpType, dbo_vw_ActiveEmployeeList.BaseRate, dbo_vw_ActiveEmployeeList.DOB
ORDER BY dbo_vw_ActiveEmployeeList.Supervisor, dbo_vw_ActiveEmployeeList.DeptID, dbo_vw_ActiveEmployeeList.JobCodeID, dbo_vw_ActiveEmployeeList.LastName;
Here is what I have so far for the sub Routine:
Public Sub Supervisor()
Dim MyDb As Database
Dim MyRs As DAO.Recordset
Set MyDb = Database
Set MyRs = MyRs.OpenRecordset("qry_Ac
Do While Not MyRs.EOF
DoCmd.OutputTo , acOutputReport, "rpt_Active_Employee_By_De
acFormatPDF, , "Supervisor = " & MyRs.Supervisor.Value
If remember I need to use a QueryDef but I am not sure how to do this.
Thanks for any help with this.