Export report in Desktop with account name (1 Viewer)

theinviter

Registered User.
Local time
Yesterday, 20:56
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
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:56
Joined
Oct 29, 2018
Messages
21,613
Maybe you meant?

... & MyFileName & ".pdf"
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:56
Joined
Feb 19, 2002
Messages
43,720
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

Top Bottom