OutputTo command for Snapshot

G

Guest

Question: How would I write the code for the "OutputTo" statement to send a
report as a snapshot format? I know when you create a macro in Access (I'm
using 97) the option is there to create in snapshot format. But in actual
code, the format is not given. Is there a way to do this?
 
S

SusanV

DoCmd.OutputTo acReport, "NameOfReportYouWantToExport",
"SnapshotFormat(*.snp)", "FullPathWhereFileWillBeSavedTo", False, ""

(The False at the end is to not open the snapshot viewer, change to True if
you want to preview it)
 
R

Rick Brandt

MCyn said:
Question: How would I write the code for the "OutputTo" statement to
send a report as a snapshot format? I know when you create a macro in
Access (I'm using 97) the option is there to create in snapshot
format. But in actual code, the format is not given. Is there a way
to do this?

DoCmd.OutputTo acOutputReport,"ReportName","Snapshot Format","FilePath"
 
G

Guest

SusanV, thank you so much...that worked perfectly, I actually had that as my
code, but was leaving out the quotation marks around the
SNAPSHOTFORMAT(*.SNP). Now it works...thanks again!
 
D

David C. Holley

Basically its just using the DoCmd.OpenReport statement and using the
appropriate options. The VBA code window should give you the assorted
arguments for OpenReport and the appropriate values needed.
 
R

Ray S.

I NEED SIMILAR HELP...PLEASE SEE BELOW...MY QUESTION IN CAPS.

David C. Holley said:
Basically its just using the DoCmd.OpenReport statement and using the
appropriate options. The VBA code window should give you the assorted
arguments for OpenReport and the appropriate values needed.

I HAVE A FORM WHERE THE USER CLICKS ON A BUTTON, WHICH RETURNS TO HIM A
PRINT PREVIEW OF A REPORT...I'D LIKE FOR HIM TO THEN HAVE THE CHOICE OF
SENDING THE OUTPUT OF THAT PREVIEWED REPORT TO A SNAPSHOT FILE. I TRIED TO
FOLLOW THE IDEA OF CREATING A MACRO, BUT I DON'T REALLY FOLLOW THAT...I
TRIED, BUT CAN'T FIGURE OUT HOW TO CREATE THE MACRO...I VIEW MY CODE FOR THE
BUTTON AND SEE WHERE THE DOCMD.OPENREPORT "WHATEVER", ACPREVIEW LINE IS, BUT
I DON'T KNOW HOW TO INCORPORATE THE DO.CMD.OUTPUTTO ACOUTPUTREPORT,
"WHATEVER", "SNAPSHOT FORMAT", "FILEPATH" TO GIVE THE USER THE OPTION TO SEND
THE PREVIEWED REPORT TO A SNAPSHOT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top