Export report in Desktop with account name

theinviter

Registered User.
Local time
Today, 02:53
Joined
Aug 14, 2014
Messages
244
Dears teams;
Hi,

I would like to seek your help, i Have a report and want saved it with current date as month and year and account name.
as i want to create a button, once the use clicks it then it will create a folder on Desktop Named " Evaluation report" and save the file as PDF inside this folder in desktop.

as tried below but not succeful;

Private Sub Command229_Click()
Dim MyFileName As String

MyFileName = Me.Account_Name


DoCmd.OutputTo acOutputReport, "Clinics_Report", acFormatPDF, "C:\Users\Default\Desktop & MyFileName.PDF"

End Sub
 
Maybe you meant?

... & MyFileName & ".pdf"
 
Or perhaps:

... & MyFileName & Format(Date() "yyyy_mm") & ".pdf"

Using ym rather than my allows you to see all the files for a year together rather than seeing the files for january together.
 

Users who are viewing this thread

Back
Top Bottom