LeLeBrown
asked on
Access 2007 Report
I have a Access 2007 report that I want to convert to PDF and then save. I want the save as dialog box to come up so the user can choose a folder to save it to. I am using a macro (specs below) to create the PDF and tried using the msofiledialogsaveas to open the dialog box. the trouble is, I can't get them to work together.
Object Type: Report
Object Name: rptPendingDateChanges
Output Format: PDF Format(*.pdf)
output file: had a path and file name here before
auto start: NO
Template File:
Encoding:
Output Quality: Print
Object Type: Report
Object Name: rptPendingDateChanges
Output Format: PDF Format(*.pdf)
output file: had a path and file name here before
auto start: NO
Template File:
Encoding:
Output Quality: Print
the macro can not take variables. To make this work using the msofiledialogsaveas, you have to create a function in vba.
post the codes you are using with the msofiledialogsaveas.
you can do this without using a macro if you want.
post the codes you are using with the msofiledialogsaveas.
you can do this without using a macro if you want.
ASKER
Capricorn1,
with msofiledialogsaveas i just have that statement right now. it has been a while since I have created a file in Access. All I have right now is below.
DoCmd.SetWarnings False
strStatus = SysCmd(acSysCmdSetStatus, "Creating report, please wait ...")
DoCmd.RunMacro "ReportToPDF"
strStatus = SysCmd(acSysCmdClearStatus )
Set dlgOpen = Application.FileDialog(mso FileDialog SaveAs)
with msofiledialogsaveas i just have that statement right now. it has been a while since I have created a file in Access. All I have right now is below.
DoCmd.SetWarnings False
strStatus = SysCmd(acSysCmdSetStatus, "Creating report, please wait ...")
DoCmd.RunMacro "ReportToPDF"
strStatus = SysCmd(acSysCmdClearStatus
Set dlgOpen = Application.FileDialog(mso
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or you can use this sample db
dbSavePDFAs.mdb
dbSavePDFAs.mdb
ASKER
Capricorn1,
Thanks!! This worked great!
Thanks!! This worked great!
If you are using the "Microsoft Office Save as PDF Plug-in", you can setup the "Adobe PDF" printer to ask for file prompt before printing the file (right click your adobe printer in your printer list and show properties, go in the general tab).