I am having trouble getting a report to email that have criteras. I am trying the below code but keep getting an Object required error. Any suggest are welcome
Private Sub Command9_Click()
On Error GoTo Err_Command9_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stManager As String
stManager = "[Manager Email] = " & " '" & subfrmExamsavg![mgrEmail] & "'"
stLinkCriteria = "[Class]=" & Chr(34) & Me![Class] & Chr(34) & " AND [Manager]= " & Chr(34) & Me![Manager] & Chr(34)
stDocName = "rptExamsavg"
DoCmd.ApplyFilter qryExamsavg!stDocName, stLinkCriteria
DoCmd.SendObject acSendReport, stDocName, A_FORMATRTF, stManager, , , "DFT 104 Exam Grades", "If there is any questions, Please feel free to call or email me."
Exit_Command9_Click:
Exit Sub
Err_Command9_Click:
MsgBox Err.Description
Resume Exit_Command9_Click
End Sub
Private Sub Command9_Click()
On Error GoTo Err_Command9_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stManager As String
stManager = "[Manager Email] = " & " '" & subfrmExamsavg![mgrEmail] & "'"
stLinkCriteria = "[Class]=" & Chr(34) & Me![Class] & Chr(34) & " AND [Manager]= " & Chr(34) & Me![Manager] & Chr(34)
stDocName = "rptExamsavg"
DoCmd.ApplyFilter qryExamsavg!stDocName, stLinkCriteria
DoCmd.SendObject acSendReport, stDocName, A_FORMATRTF, stManager, , , "DFT 104 Exam Grades", "If there is any questions, Please feel free to call or email me."
Exit_Command9_Click:
Exit Sub
Err_Command9_Click:
MsgBox Err.Description
Resume Exit_Command9_Click
End Sub