Set savename of report.snp

wcrc

Registered User.
Local time
Today, 12:55
Joined
Mar 10, 2003
Messages
27
I want to set the savename of a report by using a report number generated on the report itself.

Something like: "Docmd.Save as [ReportNumber].snp"

Any ideas? It might be dead simple for all I know.

Thanks in advance as usual
 
I would suggest the following:

To save your report as a snp file use the "OutputTo" action of the DoCmd object:

DoCmd.OutputTo

See the VBA help for all the arguments available. You can specify the output name.

Hope I helped
 
I think what ur looking for is the .caption property of the report.

I beleve this property is used to create the filename.

give it a try






:cool:ShadeZ:cool:
 
Sorry for the delay in the reply but the boss needed me for super important *mundane* server tasks.

Is there a way have this output to a snapshot vs a report format?

This is about as good as I have been able to get.


DoCmd.OpenReport stDocName, acPreview
DoCmd.OutputTo.acOutputReport , [Report Number], [.snp], [T:\Calibration Lab\Calibration Certs\2003 Certs], ["C:\Program Files\Snapshot Viewer\SNAPVIEW.EXE"]




I should be able to reply until 4pm EST

Thanks
 
Last edited:
You need to rewrite your lines like this:

DoCmd.OpenReport stDocName, acPreview

DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
"T:\Calibration Lab\Calibration Certs\2003 Certs\" & stDocName.name & ".snp", True

now the file that will be created will be in the directory "T:\Calibration Lab\Calibration Certs\2003 Certs" and the name of the file will the report name.

If you want the value of a text box as the file name use something like "txtYourTextBox.value" instead of "stDocName.name".

Finally, if you don't want the snapshot viewer to open up after each save, remove the ", True".
 
That worked like a charm

Thanks again
 

Users who are viewing this thread

Back
Top Bottom