Hello,
Having a slight issue. I am kinda new to access.
I have an option group and one of those (Case 8) is used to email a report. I know some info about trapping and error handling, but am not sure where to put it in option group code to stop the error from happening when I close the email without sending. Here is my code.
Private Sub btnMatLog_Click()
DoCmd.SetWarnings False
Select Case SortOptionGrp.Value
Case 1
DoCmd.OpenForm "frmMaterialOutgoing", acNormal
Case 2
DoCmd.OpenReport "Material Menu - Checklist", acViewPreview
Case 3
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 4
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 5
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 6
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 7
DoCmd.OpenForm "frmMaterial_Request", acNormal
Case 8
DoCmd.SendObject acSendReport, "rptMaterial_Request", acFormatPDF, "email@domain.com", "email@domain.com", , "Material Request", "Please see the attached material request form"
End Select
DoCmd.SetWarnings True
End Sub
Thanks for the help!
Having a slight issue. I am kinda new to access.
I have an option group and one of those (Case 8) is used to email a report. I know some info about trapping and error handling, but am not sure where to put it in option group code to stop the error from happening when I close the email without sending. Here is my code.
Private Sub btnMatLog_Click()
DoCmd.SetWarnings False
Select Case SortOptionGrp.Value
Case 1
DoCmd.OpenForm "frmMaterialOutgoing", acNormal
Case 2
DoCmd.OpenReport "Material Menu - Checklist", acViewPreview
Case 3
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 4
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 5
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 6
DoCmd.OpenReport "Material Menu - Material Log Report", acViewPreview
Case 7
DoCmd.OpenForm "frmMaterial_Request", acNormal
Case 8
DoCmd.SendObject acSendReport, "rptMaterial_Request", acFormatPDF, "email@domain.com", "email@domain.com", , "Material Request", "Please see the attached material request form"
End Select
DoCmd.SetWarnings True
End Sub
Thanks for the help!