Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro Question (2003)

    I have a macro that selects a specific report and exports to a drive on my server. I was wondering if it's possible to give the report the name of the selected report plus a date and time versus a static name like I'm doing now.

    Object Type: Report
    Object Name: =[Forms]![frmReports]![lstReports]
    Output File: sharepointsitesteamsitesHOAProjectsreplacementrese rveReportstest.rtf

    In the above example, I'd like test.rtf to be the report selected plus the date and time. Any insihgt would be much appreciated! Thanks in advance.

  2. #2
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro Question (2003)

    Thanks for the quick response Hans! I gave that a shot, but I'm getting an error, an action failed. Any clues?

    Action Name:
    OutputTo
    Arguements:
    3, Summary by Association, RichTextFormat(*.rtf), sharepointsitesteamsitesHOAProjectsreplacementrese rveReports" & [Forms]![frmReports]![lstReports] & Format(Now();"yyyymmddhhnnss") & ".rtf", No, , 0

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro Question (2003)

    Error corrected by HansV

    Set the Output File argument to

    ="sharepointsitesteamsitesHOAProjectsreplacementre serveReports" & [Forms]![frmReports]![lstReports] & Format(Now(),"yyyymmddhhnnss") & ".rtf"

    You can use a different date/time format if you wish, but you cannot use a slash / or a colon : because these characters aren't allowed in file names.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro Question (2003)

    Sorry, the semicolon in the Format function should have been a comma:
    <code>
    ... Format(Now(),"yyyymmddhhnnss") ...
    </code>
    (my system uses semicolon as list separator, I forgot to change it in the post; I have done so now)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •