After sweating over this problem and not getting anywhere with search, I found the solution is almost as simple as MS describes in their Knowledge Base article.
M$'s example to duplicate the problem
Code:
Sub OutputSnapshot()
DoCmd.OutputTo acOutputReport, "Alphabetical List of Products", acFormatSNP, "C:\My Documents\", True
End Sub
What they don't explain is you need to add the file name to the OutPutFile argument. You can either hard code the name, or you can use a variable if you want to assign different names each time your run the code. In this example, I change the name of the .snp file by assigning the current date to the name.
Code:
Sub OutputSnapshot()
Dim myFile as String
myFile = "SomeName" & Format(Date(),"mmddyy") & ".snp"
DoCmd.OutputTo acOutputReport, "Alphabetical List of Products", acFormatSNP, "C:\My Documents\"[blue] & myFile[/blue], True
End Sub
One hint is to make sure you don't have any invalid characters in the file name which is why my example takes the / out of the date format.
HTH
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.