DoCmd.RunCommand acCmdExport

  • Thread starter Bruno Campanini
  • Start date
B

Bruno Campanini

With:
DoCmd.OpenReport "R_IndiceEspLSR", acViewPreview
DoCmd.RunCommand acCmdExport

a Dialog Box is opened allowing FileName, Path, FileType
insert.

Is it possible to pass directly - by code - those parameters
without having any Dialog Box open?

Bruno
 
D

Dirk Goldgar

in message
With:
DoCmd.OpenReport "R_IndiceEspLSR", acViewPreview
DoCmd.RunCommand acCmdExport

a Dialog Box is opened allowing FileName, Path, FileType
insert.

Is it possible to pass directly - by code - those parameters
without having any Dialog Box open?


Check out the DoCmd.OutputTo method in the online help.
 
B

Bruno Campanini

in message



Check out the DoCmd.OutputTo method in the online help.

Well, there are several ways to get the result, including
DoCmd OutputTo, ok.
But what about using the two instructions above?

I think there is no way to complete the mission with that
code, I'm just looking for a confirmation.

Bruno
 
D

Dirk Goldgar

Bruno Campanini said:
Well, there are several ways to get the result, including
DoCmd OutputTo, ok.
But what about using the two instructions above?

I think there is no way to complete the mission with that
code, I'm just looking for a confirmation.


Consider it confirmed. That RunCommand constant will always open the Export
dialog; that's what it's for. If you already know where and in what format
you want to save the file, you don't want to open that dialog. If you want
to open a similar dialog but with some of the information filled in already,
then you can call the Windows File Save dialog (using code that has been
posted a number of places) to prompt the user for the folder location and/or
name, and then use OutputTo to export the report to the location and file
specified by the user.
 
B

Bruno Campanini

Consider it confirmed. That RunCommand constant will always open the
Export dialog; that's what it's for. If you already know where and in
what format you want to save the file, you don't want to open that dialog.
If you want to open a similar dialog but with some of the information
filled in already, then you can call the Windows File Save dialog (using
code that has been posted a number of places) to prompt the user for the
folder location and/or name, and then use OutputTo to export the report to
the location and file specified by the user.

Ok Dirk, thanks for useful info.

Bruno
 

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