Results 1 to 3 of 3
  1. #1
    fiveupnorth is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2017
    Posts
    5

    Including Current Date in a Filename while using ExportWithFormatting

    Hello.



    I have seen a few posts that says it is possible to add the current date to a filename while exporting with a Macro. I have not been able to figure it out.

    Here is my Output File line
    S:\EAS Weekly Reports\Final Docs\2018 Working Files\Department - Agriculture.pdf

    What should it look like to have the current date included?

    Thanks for any help on this!

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure, best to convert the macro to VBA and do it there:
    "S:\EAS Weekly Reports\Final Docs\2018 Working Files\Department - Agriculture " & Format(Date(),"yyyymmdd") & ".pdf"

    Note: it is bad form to use drive letters in databases. Change it to the full path. Drive letters change too easily and are meaningless.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    'full path' uses Universal Naming Convention (UNC). More info at https://msdn.microsoft.com/en-us/lib...ng_conventions
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-25-2016, 09:12 AM
  2. Replies: 5
    Last Post: 11-30-2014, 08:12 PM
  3. ExportWithFormatting Error
    By voro in forum Import/Export Data
    Replies: 3
    Last Post: 10-29-2012, 09:29 AM
  4. Replies: 1
    Last Post: 06-17-2011, 12:59 AM
  5. Date and time in filename
    By frankesjoberg in forum Import/Export Data
    Replies: 1
    Last Post: 03-02-2010, 12:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums