XsivelyLost
Technical User
I searched the forum and found several ideas to even get to where I am now. BUT!, I entered the following code to filter my report:
Private Sub PrintRptBttn_Click()
On Error GoTo Err_PrintRptBttn_Click
Dim stDocName As String
Dim strFilter As String
stDocName = "EmpActivityReport"
strFilter = "EmpNumber" = Forms!EmpAttForm!EmpNumber
DoCmd.OpenReport "EmpActivityReport", acPreview, , strFilter
Exit_PrintRptBttn_Click:
Exit Sub
Err_PrintRptBttn_Click:
MsgBox Err.Description
Resume Exit_PrintRptBttn_Click
End Sub
This finally got past all the errors and I can preview the report but nothing is showing up on it. It's like the EmpNumber went south which error'd all the calc fields. Can someone tell me what I am missing? The report is based on a query of two tables. *Employees* & *Occurrence Activity* (Yes, the space has been a nightmare! I'm Learning!) Anyway, Primary in the *Employees* table is the EmpNumber. This number drives the Attendance form. I type it in and all EmpInfo is filled in for me. I follow with whatever occurrence activity has happened over the past week. I can run the report from the reports tab and it's fine, although 57 pages long. I am not telling the procedure something it needs to know apparently. The FilterOn on the Report is set to Yes. Any help would be greatly appreciated.
Thanks,
XsivelyLost
Private Sub PrintRptBttn_Click()
On Error GoTo Err_PrintRptBttn_Click
Dim stDocName As String
Dim strFilter As String
stDocName = "EmpActivityReport"
strFilter = "EmpNumber" = Forms!EmpAttForm!EmpNumber
DoCmd.OpenReport "EmpActivityReport", acPreview, , strFilter
Exit_PrintRptBttn_Click:
Exit Sub
Err_PrintRptBttn_Click:
MsgBox Err.Description
Resume Exit_PrintRptBttn_Click
End Sub
This finally got past all the errors and I can preview the report but nothing is showing up on it. It's like the EmpNumber went south which error'd all the calc fields. Can someone tell me what I am missing? The report is based on a query of two tables. *Employees* & *Occurrence Activity* (Yes, the space has been a nightmare! I'm Learning!) Anyway, Primary in the *Employees* table is the EmpNumber. This number drives the Attendance form. I type it in and all EmpInfo is filled in for me. I follow with whatever occurrence activity has happened over the past week. I can run the report from the reports tab and it's fine, although 57 pages long. I am not telling the procedure something it needs to know apparently. The FilterOn on the Report is set to Yes. Any help would be greatly appreciated.
Thanks,
XsivelyLost