FATAL ERROR WHEN SENDING ACCESS REPORT TO PDF....

M

Mike S. S.

Well, I have narrowed down the problem. The form where the command button is
that launches the report when opened directly works fine and the report will
output to a PDF when that is chosen as the printer. HOWEVER, I do use the MS
built-in switchboard as a menu system, and when I launch the form from that
menu and then click the button to produce the report and do a File/Print to
the Adobe PDF, it crashes! So the culprit lies somewhere in something that
the Switchboard does in launching the form. Could the FilterOn=True that the
Switchboard does have something do to with it?

Anyone have any ideas at all???????????
 
A

Allen Browne

Hi Mike

The fact that it works one way and not the other suggests that there is some
kind of corruption in your database.

1. Turn off Name AutoCorrect
Uncheck the boxes under Tools | Options | General Name AutoCorrect.
Reasons:
http://members.iinet.net.au/~allenbrowne/bug-03.html

2. Compact the database to get completely rid of the Name AutoCorrect junk:
Tools | Database Utilities | Compact

3. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Compact again.

5. Remove any references you do not need, by opening a code window and
choosing References from the Tools menu. Typically you need Access, VBA, and
DAO. More info:
http://members.iinet.net.au/~allenbrowne/ser-38.html

6. Compile. The compile will fail if you removed too many references, or if
there are problems with the code.

If it still fails, the next step is to create a new (blank) database, turn
off Name AutoCorrect, set your references, and import everything (File | Get
External | Import). This forces Access to recreate all your objects.

BTW, when Acrobat installs, it loads the Acrobat Assistant into your Windows
Start menu. It is important that you do NOT remove this item, i.e. you need
to allow AcroTray.exe to load when Windows starts.
 
M

Mike S. S.

Well Allen I found the problem and solution. Why there is a problem with ADO
code I don't understand, so instead of the rs.open method, I create a
temporary DAO querydef and substitute the code to process the Switchboard's
case statements for which button is clicked....and it works perfectly and
causes no problems when the form is opened and the report is previewed from
the button on that form and the ADOBE PDF Writer is chosen to print the
report. Don't know wny....just know that it works!

Thanks again for your input.
 
Top