Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
OutputTo Does Not Save PDF Files
Ryan deGuzman 
    
9 months ago
I'm can't figure out, for the life of me, why this isn't working. I've removed the moved the outputto command from the OnLoad event to a button. I've moved it around to other events and it still doesn't save. It was working earlier and now it doesn't. Is my context wrong? Is there a workaround to save a pdf to a drive?
Ryan deGuzman OP  @Reply  
    
9 months ago

John Davy  @Reply  
         
9 months ago
Hi Ryan, I have looked at your code. Here is a line of mine that works and outputs a pdf:
DoCmd.OutputTo acOutputReport, "ForExportR", acFormatPDF, TempVars!mylocation & "Parts.pdf"  Your code has several variables. I would test your code by replacing  strLettername with the actual path and see what it looks like.  I am assuming that you checked to make sure the drive is available to you. HTH  John
Ryan deGuzman OP  @Reply  
    
9 months ago
Yes, Access has access to  the drive. So, I know that’s not the issue. I’ve replaced all the variables with the actual paths and I get the same results. A pop-up window shows that the Access is Outputting the report to the proper location, and then it stops. I look in the directory and Access creates the Folder but doesn’t process or save  the PDF. I’ve changed the default printer to the report to “Microsoft to PDF” and nothing happens. It just stopped working. It’s weird, because it was working before I placed this automated in the On Load, On Open, or  On Timer.
John Davy  @Reply  
         
9 months ago
My guess is that your data is not loaded at this point so your report is not going to have the data available. Try running the report by itself and see if it runs. Run your routine from a button n the form (after the data has loaded)  john
Richard Rost  @Reply  
          
9 months ago
Before you try running it in an event, see if you can get it to run from a button like John said.
Ryan deGuzman OP  @Reply  
    
9 months ago
I've isolated the OutputTo to a button with just one line of code and it still doesn't work. Is there a workaround outside of using the OutputTo command?
Ryan deGuzman OP  @Reply  
    
9 months ago

John Davy  @Reply  
         
9 months ago
Hi Ryan, Does the report run by itself?  John
Richard Rost  @Reply  
          
9 months ago
When you say it doesn't work, can you be a little more specific? What's happening? Does nothing happen? Also, make sure that is a valid folder and that you have rights to write to it. I would suggest putting it in your database folder directly to start off with.
Ryan deGuzman OP  @Reply  
    
9 months ago
Yes. I can open the report up fine when I directly run the report.
John Davy  @Reply  
         
9 months ago
Hi Ryan, I tested a few thing in your code but cannot recreate all that you have for I don't have the entire database, but I am quite sure your problem is with the variables that you have. You need to be sure that strOrders is giving you what you think it is, stDirectoryPath is giving you what you think it is and tempvars is giving you what you think it is. Simplify your code with hard coded paths first and get it to work. The problem is in the variable (maybe a backslash or space in the variable) After it is working (it does work and outputs a PDF but not with your variables)  John
Ryan deGuzman OP  @Reply  
    
9 months ago
I got it to work! The report itself was the problem. I have the report creating barcodes and printing them out. If an item doesn’t have a barcode the report errors but doesn’t inform me. It just stopped processing. I added 1 line before the barcode prints:

If WebPayment <> “Pay at Register” then Exit Sub.

It saved the file just fine! Thanks John for your help! I wouldn’t have thought to check the report since all the other reports I saved had barcodes!

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

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: 5/2/2026 12:22:01 AM. PLT: 0s