K
Kyle
I have a form on which I placed a button that allows me to print the
page of the report for the record displayed in the form. When I click
on the button to print the report page, I get the error "data type
mismatch in criteria expression". I'm not sure where my code is
failing, but I know it's in the code; what am I missing?:
Private Sub Print_Memo_Click()
On Error GoTo Err_Print_Memo_Click
Dim stDocName As String
Dim strRecID As String
strRecID = "[Event_ID]='" & Me![Event_ID] & "'"
stDocName = "rpt_Detail_Request_Memo"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , strRecID
DoCmd.PrintOut acPages, 1, 1
Exit_Print_Memo_Click:
Exit Sub
Err_Print_Memo_Click:
MsgBox Err.Description
Resume Exit_Print_Memo_Click
End Sub
Many thanks for any and all help!
page of the report for the record displayed in the form. When I click
on the button to print the report page, I get the error "data type
mismatch in criteria expression". I'm not sure where my code is
failing, but I know it's in the code; what am I missing?:
Private Sub Print_Memo_Click()
On Error GoTo Err_Print_Memo_Click
Dim stDocName As String
Dim strRecID As String
strRecID = "[Event_ID]='" & Me![Event_ID] & "'"
stDocName = "rpt_Detail_Request_Memo"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , strRecID
DoCmd.PrintOut acPages, 1, 1
Exit_Print_Memo_Click:
Exit Sub
Err_Print_Memo_Click:
MsgBox Err.Description
Resume Exit_Print_Memo_Click
End Sub
Many thanks for any and all help!