M
Michael
I have a button that I have created which I would like to run a report
with 2 separate conditions. I want it to open the report based on the
current record's employee id & the current record's pay period end
date. I came up with the code below but I get a Type Mismatch. Can
anyone give me any ideas where my code is wrong?
Private Sub PrintHoursSummary_Click()
On Error GoTo Err_PrintHoursSummary_Click
Dim stDocName As String
stDocName = "TimesheetTimesbyVendorIDbyPayPeriod"
strWhere = "[vendorID] = " & "" & Me.VendorID & "" And strWhere =
"[DatePayPeriodEnd] = " & "" & Me.DatePayPeriodEnd & ""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_PrintHoursSummary_Click:
Exit Sub
Err_PrintHoursSummary_Click:
MsgBox Err.Description
Resume Exit_PrintHoursSummary_Click
End Sub
with 2 separate conditions. I want it to open the report based on the
current record's employee id & the current record's pay period end
date. I came up with the code below but I get a Type Mismatch. Can
anyone give me any ideas where my code is wrong?
Private Sub PrintHoursSummary_Click()
On Error GoTo Err_PrintHoursSummary_Click
Dim stDocName As String
stDocName = "TimesheetTimesbyVendorIDbyPayPeriod"
strWhere = "[vendorID] = " & "" & Me.VendorID & "" And strWhere =
"[DatePayPeriodEnd] = " & "" & Me.DatePayPeriodEnd & ""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_PrintHoursSummary_Click:
Exit Sub
Err_PrintHoursSummary_Click:
MsgBox Err.Description
Resume Exit_PrintHoursSummary_Click
End Sub