create a macro to export to an excel file using the current date as a name

I'm trying to export a report to a pdf file so the filename varies with the date. I'm using the following syntax:

"C:\Data_Reports\FileName" & Format(Date(), "yyyymmdd") & ".pdf"

The report was exported, but the filename is missing the date and pdf extension.
 
What is your code to export the report?
 
I am simply using the standard exportwithformatting action in a macro and using the output filename shown in my earlier thread. Ideally I would like the filename to include a unique identifier such as a field value from the report.
 
Sorry, I don't use macros. I would expect what you have to work, but perhaps macros can't resolve the concatenation. You'd have a lot more control with VBA, if you feel like switching.
 
I'm trying to do similar task, exporting a report to a pdf via a exportwithformatting action. The output filename is shown below. The macro exports the file but ignores all the concatenated sytnax.


"C:\Data_Reports\" & Forms![BROKERS WITH POLICIES GT5]![Sub_gt5] & ".pdf"
 
I retested the syntax noted in my previous reply, it works fine. Thanks again everyone for your help.
 

Users who are viewing this thread

Back
Top Bottom