J
Jake F
I created a button to save a report in a designated folder. The date
parameter is a box on the form the query for the report runs off of. I want
to include that date field in my report so I know what parameters I ran the
report on by looking at the contents of the folder. I tried to code the
start date into my stOuputFile portion but didn't do it correctly. Here's my
code so far for the button. Let me know if anything should be cleaned up as
well. Thanks.
Private Sub Cmd_MailEngineerRpt_Click()
On Error GoTo Err_Cmd_MailEngineerRpt_Click
Dim stDocName As String
stDocName = "rptjf_newengineer"
stOutputFile = "H:\Engineer Lists\New Engineer List " &
[frmjf_new]![EngineerStartDate] & ".pdf"
DoCmd.OutputTo acReport, stDocName, "PDF Format(*.pdf)", stOutputFile,
True, , , acExportQualityScreen
Me![TimeSent] = Now()
Exit_Cmd_MailEngineerRpt_Click:
Exit Sub
Err_Cmd_MailEngineerRpt_Click:
MsgBox Err.Description
Resume Exit_Cmd_MailEngineerRpt_Click
End Sub
parameter is a box on the form the query for the report runs off of. I want
to include that date field in my report so I know what parameters I ran the
report on by looking at the contents of the folder. I tried to code the
start date into my stOuputFile portion but didn't do it correctly. Here's my
code so far for the button. Let me know if anything should be cleaned up as
well. Thanks.
Private Sub Cmd_MailEngineerRpt_Click()
On Error GoTo Err_Cmd_MailEngineerRpt_Click
Dim stDocName As String
stDocName = "rptjf_newengineer"
stOutputFile = "H:\Engineer Lists\New Engineer List " &
[frmjf_new]![EngineerStartDate] & ".pdf"
DoCmd.OutputTo acReport, stDocName, "PDF Format(*.pdf)", stOutputFile,
True, , , acExportQualityScreen
Me![TimeSent] = Now()
Exit_Cmd_MailEngineerRpt_Click:
Exit Sub
Err_Cmd_MailEngineerRpt_Click:
MsgBox Err.Description
Resume Exit_Cmd_MailEngineerRpt_Click
End Sub