Pass parameters to RunCommand acCmdExport

K

KurtW

Hello: Is it possible to pass parameters to acCmdExport such that the dialog
that appears is prepopulated with 1) A suggested file name that I create, 2)
A suggested path for storage and 3) A suggested export format (snapshot.)

Thanks
 
A

Allen Browne

Try the OutputTo method:
Docmd.OutputTo acOutputTable, "Table1", acFormatSNP, "C:\MyFile.snp"

Use a small unbound form where the user can enter a file name, and select a
file format.

For the code to open the Windows FileSaveAs dialog so the user can specify a
file name and location, use the API call in this link:
http://www.mvps.org/access/api/api0001.htm

To let the user select the output format, create a listbox or combo based on
the values of acFormat. (Press F2 in the code window to open the Object
Browser to get these values.)
 
K

KurtW

Thanks Allen:

I will look over your suggestion. But perhaps I should have mentioned that I
was trying to avoid going directly to a snapshot file because, as I
understand it from my experimenting, the snapshot must be saved to disk
before it can be viewed. If I do it this way I will wind up spawning
thousands of files.

It was my hope to open the reports in preview mode to allow the user to
print off roughs and then decide, on a case-by-case basis, to save the report
or not.

Thanks. I will look further into what you have said.

Kurt
 

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