Print to file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button that causes a report to print to file. Within this button I
would like to add code that renames (and relocates) the file just printed. I
would appreciate suggestions. thank you all very much!

Ken C.

PS: how do I update my out of date login email address?
 
Try using the FileCopy command to copy and rename, for example
FileCopy strLocalReport, strSaveReport
This is FileCopy "from_Path_ReportName" "To_Path_ReportName"

In this case the strSaveReport was defined with a file name "DailyReport"
and then I appended the date and time. Here is my example of the date/time:

dtTimeStamp = DatePart("yyyy", dtTimeStamp) & " " & Format(DatePart("m",
dtTimeStamp), "00") & " " & Format(DatePart("D", dtTimeStamp), "00") & " " &
DatePart("h", dtTimeStamp) & " " & DatePart("n", dtTimeStamp)

This results in a new file as shown here: DailyReport_2006 10 26 12 39.mdb
This provides me with the Year, month, Day, Hour, Minute when this report
was generated.

to delete a file the kill command
Kill strLocalReport

Hope that helps you out,

SteveD
 
Back
Top