Hello.
Okay, so I have an Option Group with 6 reports on the Right hand side of a form. On the left, I have 4 command buttons. 1) Preview 2) Print 3) Save off 4) Email.
I want the user to be able to select a report's radio button and click one of the four command buttons. Currently, Preview and Print work. But the Reports have parameters in their queries. I'm prompted for the values for the Print and Preview buttons, but for some reason, I can not get the Email command button to work.
I also don't know where to start for saving the report to a network drive. I'm assuming I'll run into the same error.
(Error: Argument not Optional)
Here's the code I have so far. Any ideas??
THANKS A MILLION!
Okay, so I have an Option Group with 6 reports on the Right hand side of a form. On the left, I have 4 command buttons. 1) Preview 2) Print 3) Save off 4) Email.
I want the user to be able to select a report's radio button and click one of the four command buttons. Currently, Preview and Print work. But the Reports have parameters in their queries. I'm prompted for the values for the Print and Preview buttons, but for some reason, I can not get the Email command button to work.
I also don't know where to start for saving the report to a network drive. I'm assuming I'll run into the same error.
(Error: Argument not Optional)
Here's the code I have so far. Any ideas??
THANKS A MILLION!
Code:
Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click
'This procedure used in Preview_Click and Print_Click Sub procedure.
'Preview or print report selected in the SelectReports option group.
'Then close the Select Reports Dialog Form.
Select Case Me!SelectReports
Case 1
DoCmd.OpenReport "R_Reasonableness", PrintMode
Case 2
DoCmd.OpenReport "R_ADJ", PrintMode
Case 3
DoCmd.OpenReport "R_Detail", PrintMode
Case 4
DoCmd.OpenReport "R_Detail2", PrintMode
Case 5
DoCmd.OpenReport "R_Summary", PrintMode
Case 6
DoCmd.OpenReport "R_Summary2", PrintMode
End Select
DoCmd.Close acForm, "F_REPORTS"
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
Resume Exit_Preview_Click
End Sub
Private Sub Email_Click()
'E-Mail selected report. This procedure uses the PrintReports
'Sub procedure defined in (General) section of this module.
DoCmd.SendObject acReport, PrintReports, "RichTextFormat(*.rtf)", "", "email@email.com", "", "MfrReb Report", "This email is being sent from the MR Database", True, ""
End Sub
Private Sub Print_Click()
'Print selected report. This procedure uses the PrintReports
'Sub procedure defined in (General) section of this module.
PrintReports acNormal
End Sub
Private Sub Preview_Click()
'Preview selected report. This procedure uses the PrintReports
'Sub procedure defined in (General) section of this module.
PrintReports acPreview
End Sub
Comment