Results 1 to 3 of 3
  1. #1
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107

    OutputTo Macro Include today's date

    I have a Report that I am saving as a pdf. This is a report that will be saved every week, and I would like for the file to be saved as "WeeklyReport" + today's date. For example, today the report file name would be "WeeklyReport9-22.pdf". I am uncertain how to do this as in the OutputTo Macro, the Output file line seems to only contain strong quotes, so every word written in that line is saved.



    How can I make my file be saved with today's date?

    Thank you!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    If you use VBA instead, you can concatenate in the name so you could use

    Dim strFile As String

    strFile = "WeeklyReport" & Format(Date(), "m-dd") & ".pdf"

    and then you can use strFile in the place where the file name is in the DoCmd.OutputTo command.

  3. #3
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Thank you again Bob, you are always such a great help!

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

Similar Threads

  1. Entering Today's Date
    By Alex Motilal in forum Access
    Replies: 5
    Last Post: 08-23-2011, 12:22 AM
  2. OutputTo PDF???
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 03-17-2011, 11:39 AM
  3. Replies: 2
    Last Post: 01-12-2011, 12:00 AM
  4. Set Calendar to default to today's date
    By RickM in forum Access
    Replies: 1
    Last Post: 02-22-2009, 04:51 AM
  5. query date that is five years older than today
    By cpsummer in forum Queries
    Replies: 2
    Last Post: 09-26-2007, 02:31 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