File name date (1 Viewer)

kitty77

Registered User.
Local time
Today, 08:17
Joined
May 27, 2019
Messages
712
DoCmd.OutputTo acOutputReport, , acFormatPDF, "\\SERVER\Billing\" & [Mdid] & ".pdf"

How can I make the above include the date as part of the file name?
 

Ranman256

Well-known member
Local time
Today, 08:17
Joined
Apr 9, 2015
Messages
4,337
= "\\SERVER\Billing\" & [Mdid] & format(date(),"yymmdd") & ".pdf"
 

cheekybuddha

AWF VIP
Local time
Today, 13:17
Joined
Jul 21, 2014
Messages
2,280
Code:
  Dim filename As String
  Const FILEPATH As String = "\\SERVER\Billing\"
 
  filename = FILEPATH & Format(Date, "yyyymmdd") & "_" & [Mdid] & ".pdf"
  ' or
  filename = FILEPATH & [Mdid] & "_" & Format(Date, "yyyymmdd") & ".pdf"
  Debug.Print filename
 
  DoCmd.OutputTo acOutputReport, , acFormatPDF, filename
 

Users who are viewing this thread

Top Bottom