DoCmd.OutputTo problem

IMO

Now Known as ___
Local time
Today, 14:19
Joined
Sep 11, 2002
Messages
723
I'm using the following code to Output a report as a Text file, saving it as the name in an unbound textbox on the form
Code:
     DoCmd.OutputTo acReport, "rptAddCost", "MS-DOSText(*.txt)", "C:\Documents and Settings\temp\Desktop\(" & Me!TxtSupName & ").txt", False, ""
all works fine but what I'd like to do is save it as above adding todays date before the Name so the saved file would look like

180803(DREK02).txt

not

(DREK02).txt

I'm sure it's quite simple but I just can't get my head round it today. Most grateful for any help

IMO
 
DoCmd.OutputTo acReport, "rptAddCost", "MS-DOSText(*.txt)", "C:\Documents and Settings\temp\Desktop\(" & Me!TxtSupName & CStr(Format(Date, "ddmmyy"))& ").txt", False, ""
 
DoCmd.OutputTo acReport, "rptAddCost", "MS-DOSText(*.txt)", "C:\Documents and Settings\temp\Desktop\" & Format(date(),"yyyymmdd") & "(" & Me!TxtSupName & ").txt", False, ""

When dating files i would advice you to turn the date around like above. Otherwise sorting will go off
010103
010203
020103 (see what i mean?)

Regards

The Mailman
 
Thanks Mile and namliam, that did the trick! Ever had one of those days?!

Cheers again

IMO
 
All the time and more....

Esspecially if Mile is "in the house !":)


Regards
 
crazy.gif
 

Users who are viewing this thread

Back
Top Bottom