Link to home
Start Free TrialLog in
Avatar of LeLeBrown
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
Avatar of Remi Gelinas
Remi Gelinas
Flag of Canada image

Hello,

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).
Avatar of Rey Obrero (Capricorn1)
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.
Avatar of LeLeBrown
LeLeBrown

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(msoFileDialogSaveAs)
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or you can use this sample db
dbSavePDFAs.mdb
Capricorn1,

Thanks!!  This worked great!