Save Snapshot

V

Vayse

Hi
Is it possible for me to save a snapshot of the current report, through
code?
I was thinking of putting the code in the toolbar.

My idea is something along these lines:
Have a global variable - stCustID

So, when the user clicks the view report button, I'd have:
stCustId = me.txtCustID
stLinkCriteria = "CustID = " & stCustID
DoCmd.OpenReport "rptCustomer", acPreview, , stLinkCriteria

Then have a button in the toolbar of that report
stDirectory = "N:\" & stCustID
SaveSnapShot("rptCustomer", stDirectory)

I can do the code for checking if the directory is present, and to create a
new directory.
Its the saving of the snapshot, without prompting the user for input, that
is causing me a problem.
Thanks
Diarmuid
 
S

Steve Schapel

Diarmuid,

You can use the DoCmd.OutputTo method to save the report as a Snapshot file.

However, I've never tried it, so I am not sure whether this can be done
while the report is already open in Preview mode.

Also, I think the report would need to be based on a query that
references the current CustID in its criteria, since the OutputTo method
does not make allowance for Where condition.
 

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