Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    30

    Unanswered: Export with date in File Name

    I have a need to Export to a Text File but need to automate the output file name so that it vary's. The reason is that we need automate and run this export every day and we don't want to override it with the same name, we want to keep record of the output from day to day. Ideally we would want to put the date in the File name so we can reference the day we ran it, but it would be fine if we could increment it by 1 each export. So for example
    patients20110101.txt
    patients20110102.txt
    etc.

    Is there a way in a macro to do this?

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Look at "DemoQryToTxtA2002.mdb" (attachment, zip).
    Look at Form1 (VBA), Open Form1 and try.
    Attached Files Attached Files

  3. #3
    Join Date
    Feb 2009
    Posts
    30

    Invalid or corrupted file

    I tried opening on a XP and Windows 7 PC and both said it was an invalid or corrupted file. I'm hopeful that there is a solution available. Can you please try again?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    why not just date and timestamp it

    patients201001191328.txt
    patients201001191625.txt

    if thats too hard to read
    patients 20100119 1328.txt
    patients 20100119 1625.txt

    or similar
    patients_20100119_1328.txt
    patients_20100119_1625.txt
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Feb 2009
    Posts
    30

    time stamp

    yes, that's what I'd like as a final product but I need to have that automated. We use Macro Scheduler, a separate software, to launch Access and run a macro to print reports and export files every day at designated times. I need a macro that can date or date and time stamp in the file name as you described so that the file doesn't get overlaid every day with the same file name. How do I put a date and time stamp on the name in the macro?

Posting Permissions

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