Report to PDF Stephen Lebans Code

ions

Access User
Local time
Today, 04:01
Joined
May 23, 2004
Messages
875
Dear MS access Expert,

http://www.lebans.com/reporttopdf.htm

This code works great on some computers but on others I always get a fatal error (must compact and repair ) right after the PDF file is created and saved.

I can't figure out what is causing it and why it works on some computers but not others.

Any suggestions, ideas are greatly appreciated.

Thanks

Peter.
 
Make sure all of the computers have the same Service Pack installed for Office.
 
If you are running Access 2007/Office 2007, you don't need all the Lebans code as there is a PDF add-in which is free from Microsoft and does the whole lot in about 3 lines of code.
 
Ted thanks for the tip. I am using 2003 at the moment.

My computer has Office SP3 and I ran the Windows Updater today so I have all the latest updates. I am assuming the Windows Updater also downloads hotfix etc... for MS Office 2003?

I still unfortunately get the fatal error on my computer. I don't understand why it would work on some computers but not others.

Thanks.
 
I am assuming the Windows Updater also downloads hotfix etc... for MS Office 2003?
Not necessarily. Some hot fixes are only available as specific downloads.
I still unfortunately get the fatal error on my computer. I don't understand why it would work on some computers but not others.

Check to see if it works with YOUR login on a different computer (to narrow down any permissions issues, hopefully).
 
My computer is not connected to a domain / network. It's a standalone notebook.

Thanks.
 
I have isolated the problem to the MS Access version.

The computer that works and the computer that doesn't work are identical except for the MS Access version.

Please see the attached document for the version differences.

I am using Adobe Acrobat 8.1.6 on both computers.
I am using the same dynapdf.dll and strStorage.dll on both computers.
System32, System, and Local Folder.

The difference is the MS Access version.

Please see the difference in MS access versions.

The fatal error occurs near the end of the function because the actual pdf file is created and is viewable via Adobe Acrobat.

Code:
blRet = ConvertReportToPDF(strReport, vbNullString, strFileName & ".pdf", False, False, 0, "", "", 0, 0)
Thank you for your suggestions.
 

Attachments

Last edited:
Ions:

For the record, I have used the PDF library on Access 2003 and 2007 PCs without problems.
I just wanted to add: sometimes, Access gets its knickers in a knot over a piece of code it has previously compiled, which has changed and should be recompiled, but hasn't been (I suppose this falls under the banner of 'corruption').
VBA often copes on the original PC somehow, but moving it between PCs frequently makes VBA 'notice' the anomaly which causes the GPFs.

Long story short, before blaming the library, I'd create a new database and import everything from the current DB into it.
Try this new version out on all the different PCs.

Ben
 
6pac,

You are correct. There was some kind of corruption. When I downloaded everything fresh and imported again it worked.

Thanks to everyone who assisted me on this problem.

Appreciate it.
 

Users who are viewing this thread

Back
Top Bottom