Hi,
I have a form what I would like to export out to PDF.
I tried 2 different ways, both is working, but I get stuck, when I would like to include a date.
The current code is this:
I have a date field on the report (BILLINGMONTH) in a MMM YYYY format, but I can't include it into the filename. ANY OTHER field is working, but this on is not.
Any suggestions what do I do wrong?
Thanks in advance!
I have a form what I would like to export out to PDF.
I tried 2 different ways, both is working, but I get stuck, when I would like to include a date.
The current code is this:
Code:
Private Sub SaveAppendixTest_Click()[/INDENT]
[INDENT][/INDENT]
[INDENT][/INDENT]
[INDENT] Dim SITEID As String[/INDENT]
[INDENT] Dim fileName As String[/INDENT]
[INDENT] Dim pdfFilePath As String[/INDENT]
[INDENT] SITEID = Me.SITEID.Value[/INDENT]
[INDENT] fileName = SITEID & "-" & [CLIENT COMPANY] & "-" & [SITE Name] & ".pdf"[/INDENT]
[INDENT] pdfFilePath = "C:\Users\xyz\OneDrive\Desktop\" & fileName[/INDENT]
[INDENT] DoCmd.OutputTo acOutputReport, "Monthly Appendix", acFormatPDF, pdfFilePath, Autostart:=True[/INDENT]
[INDENT][/INDENT]
[INDENT]End Sub
I have a date field on the report (BILLINGMONTH) in a MMM YYYY format, but I can't include it into the filename. ANY OTHER field is working, but this on is not.
Any suggestions what do I do wrong?
Thanks in advance!