Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Open Report    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Open Report to Specific Record
John Rutter 
       
3 years ago
I have watched the TechHelp on Open Report to a Specific Record in Microsoft Access.  However the report I wish to open is quite long, i.e. 2+ pages.  When I run the PrintBtn, this only print previews the first page of the report, i.e. the one with the CustomerID on it.  How can I print preview (and then print) the whole report?
Kevin Robertson  @Reply  
          
3 years ago
Click on the Next Page button at the bottom of your report to preview page 2.
Kevin Robertson  @Reply  
          
3 years ago

John Rutter OP  @Reply  
       
3 years ago
Hi Kevin
Thanks for this, i feel a bit stupid now!
John Rutter OP  @Reply  
       
3 years ago
Can I now save the pdf using 2 of the fields on the form to name it?
Richard Rost  @Reply  
          
3 years ago
John: it's not your fault. It's a quirk in Access that the report preview comes up with the very bottom of the page below the bottom of the Access window so you can't see that. I hate it too. You'll see me complain about it in my videos.

Yes, when you save the PDF you can specify the filename in VBA, or set the report caption and that usually works. Usually. Use the OutputTo command. I cover it here: Export to Word - I use Word in that example, but just switch to acFormatPDF.
John Rutter OP  @Reply  
       
3 years ago
Thanks Rich, you are a breath of fresh air mate!
John Rutter OP  @Reply  
       
3 years ago
Hi Richard
After a lot of head scratching I have managed to get this to work, thank you.
Question, I can only get it to work with the CurrentPath VBA and not by selecting a folder, C:\... I just get the red text! I think this method only allows me to put in set text to name the file, and not the text from the fields? is there away around this?
Thank you in advance.
Kevin Robertson  @Reply  
          
3 years ago
How are you writing your path?
Is it enclosed in quotes?
Richard Rost  @Reply  
          
3 years ago
Yeah, your complete path has to be inside of double-quotes. Also, you need to have Admin rights to that folder or else VBA won't be able to create files there.
John Rutter OP  @Reply  
       
3 years ago

John Rutter OP  @Reply  
       
3 years ago
Not sure how many quotes are needed, the error first highlighted is CDM of "CDM Report"
Kevin Robertson  @Reply  
          
3 years ago
Try this:

DoCmd.OutputTo acOutputReport, "ProjectReportR", acFormatPDF, "C:\Users\JohnRutter\Desktop\DatabaseReports\" & "CDM Report - " & ProjectPDNumber & " " & ProjectName & ".PDF"
Kevin Robertson  @Reply  
          
3 years ago
The AutoStart parameter is optional. The default is False so you don't need to specify it unless you want to open the PDF straight away.
John Rutter OP  @Reply  
       
3 years ago

John Rutter OP  @Reply  
       
3 years ago
I get a Run-time error '2501':
John Rutter OP  @Reply  
       
3 years ago
Sorted there is a space between Database Reports in the folder name.  Thank you for your time and patience.
Kind regards John

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Open Report.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/10/2026 6:11:47 AM. PLT: 1s