Hello. I have the below from a consultant a few years ago. It exports a report and names the report to include today's name. So today's file would be "TODAY'SFILE 07-14-2009.snp"
-------------
Function Export()
Dim strdate As String
Dim stAppName As String
strdate = Format$(Date, "mm-dd-yyyy")
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OutputTo acReport, "Report Name", "snp", "\\server\Folder\File Name " & strdate & ".snp", False, "", 0
stAppName = """C:\WINDOWS\explorer.exe"" , \\server\Folder"
Call Shell(stAppName, 1)
DoCmd.Hourglass False
DoCmd.SetWarnings True
DoCmd.Quit
End Function
-------------
What I'd like to do instead, is use the date from a field in the data called "WORKDATE".
The reason for this is that the report may reflect work from other days, not just today. So I'd like the work date in the file name, instead of today. The date value in "WORKDATE" will always be the same in all records of the output.
Thanks in advance for any help or for pointing me to the right thread.
-------------
Function Export()
Dim strdate As String
Dim stAppName As String
strdate = Format$(Date, "mm-dd-yyyy")
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OutputTo acReport, "Report Name", "snp", "\\server\Folder\File Name " & strdate & ".snp", False, "", 0
stAppName = """C:\WINDOWS\explorer.exe"" , \\server\Folder"
Call Shell(stAppName, 1)
DoCmd.Hourglass False
DoCmd.SetWarnings True
DoCmd.Quit
End Function
-------------
What I'd like to do instead, is use the date from a field in the data called "WORKDATE".
The reason for this is that the report may reflect work from other days, not just today. So I'd like the work date in the file name, instead of today. The date value in "WORKDATE" will always be the same in all records of the output.
Thanks in advance for any help or for pointing me to the right thread.