Learn how you can create a VBA function that will allow you to save your Access Report as PDF with just a click of a button. No need to go to the Access Ribbon every time!Access Reports can be manually saved as PDF file.
![]() ![]()
All you have to do is:. Open the report. Go to the Access Ribbon: External Data PDF or XPS. Select the filename and folder path where you would like it to be saved. Click Publish and you’re done.Easy, right? However, if there is a need for you to repeatedly export reports, say on a daily basis, this can be a bit taxing.Don’t worry. There’s an easier way.
With just one click of a button, your report can be immediately exported to your designated folder. This can be done with the help of VBA. Just follow the steps below. Download NowIf you want to start to use the feature as soon as possible, then you can:Otherwise, if you want to DIY, you can read the contents below. Steps to Creating a VBA Function that Saves Access Report as PDF File 1. Add a command button inside your reportThis article assumes that you already have an Access Report created. Open it in design view and add a button in the Report header (as shown below).Rename the button as cmdexportPDF.
Hi Jay, Which version of Office are you currently using? According to your description, you perhaps need to be looking at the.ExportAsFixedFormat Type:=xlTypePDF method if you want to convert an excel to pdf file。. VBA code for Printing PDF file By dsivik 11 years ago I am working on a MA Access projct that I would like to Print a selected PDF file and close adobe reader after it is printed.
To do this:. While in design view, select the button. Open the Property Sheet (ALT + Enter). Go to the Other tab Name. Change the Name value to cmdexportPDF.2.
Add code for the command buttonTo add the code, you have to first add an On Click event to the button. With the command button selected, go again to the Property Sheet. Click on the Event tab. Look for On Click and select. When the Choose Builder menu pops up, select Code Builder and click OK.
![]()
This will open the VBA Editor.Now, copy the code below.Don’t forget to update values for filename and fldrPath. They each have asterisk (.) in the comment section.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |