Report to pdf problem

A

Albert S.

Hello all!

We are using Access2003/SQLServer2005 conbination with Stephen Lebans'
ConvertReportToPDF and Tom Wickerath's SendMail functions. Everything was
working well until about one month ago. When we would try to email a pdf from
some computers, it would crash Access (i.e. the Microsoft alert would appear
and the program would have to close). It started on the Server2003 machines
and spread to the XP machines and some of the Vista PCs also.

Here is what I have tried/checked:
1) Checked every computer's Access version and they are all the same.
2) Downloaded all the latest Access updates and installed them on one XP
computer to test - didn't work
3) Created a new blank .mdb, imported all the queries, forms, etc. - didn't
work
4) It DOES work on some of the Vista machines - but not on others!
5) If I step through the code, it will work for a couple of times, then it
will fail. Once it fails, it will fail everytime.
6) Downloaded the new .dll's but that didn't help. Went back to the old ones.

On the machine where I develop the Access frontend (running XP) - it works
fine. This machine also has a full version of Acrobat (v7.0). When I am done
with a new frontend, I copy it to a shared folder on a server, then push it
out to all the clients. I use the SendMail function to email Word docs and it
works fine.

On a step through, here is where it hangs (in modReportToPDF):
blRet = ConvertUncompressedSnapshot(mUncompressedSnapFile, sOutFile, _
CompressionLevel, PasswordOpen, PasswordOwner, PasswordRestrictions,
PDFNoFontEmbedding, PDFUnicodeFlags)

So the temporary snapshot file is being created, but when it gets to the
ConvertUncompressedSnapshot function, it is hanging.

We are a ways away from adopting Access2007 and I don't have much hair left
to tear out, so any suggestions would be greatly appreciated!

Thanks!
Albert S.
 
G

Gina Whipp

Albert,

1. Please copy/paste the line you are using... (ie: Call
ConvertReportToPDF("rptBoLKilograms", , "c:\" & Me.cboBillOfLadingID &
".pdf", False)

2. You say a Microsoft Alert appears, what does it say?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
A

Albert S.

Ok, here are the two lines:
blRet = ConvertReportToPDF(stDocName, vbNullString, "C:\Temp\" & stPONo &
".pdf", False, False, 150, "", "", 0, 0, 0)
stMessage = SendMail(stEmailAddress, "Theodore Front Purchase Order #" &
stPONo, , stBody, "C:\Temp", stPONo & ".pdf")
 
G

Gina Whipp

Albert,

Your line...
blRet = ConvertReportToPDF(stDocName, vbNullString, "C:\Temp\" & stPONo &
".pdf", False, False, 150, "", "", 0, 0, 0)

....only needs to say...

ConvertReportToPDF(stDocName, vbNullString, "C:\Temp\" & stPONo & ".pdf",
False, False, 150, "", "", 0, 0, 0)

However, I am slightly confused with the second line, I should have asked
for the complete code section you are using to send the eMail. Also, did
you notice this part ***' Note the Compression and Password params are not
hooked up yet.****?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
S

Stuart McCall

Gina Whipp said:
Albert,

Your line...


...only needs to say...

ConvertReportToPDF(stDocName, vbNullString, "C:\Temp\" & stPONo & ".pdf",
False, False, 150, "", "", 0, 0, 0)
<snip>

Actually, if you're going to call the routine rather than use it as an
expression, then either:

Call ConvertReportToPDF(stDocName, vbNullString, "C:\Temp\" & stPONo &
".pdf", False, False, 150, "", "", 0, 0, 0)

or:

ConvertReportToPDF stDocName, vbNullString, "C:\Temp\" & stPONo & ".pdf",
False, False, 150, "", "", 0, 0, 0

should be used.
 
A

Albert S.

Hello,

I need the blRet = part since I am sending reports in a subprocedure from a
button. Otherwise it won't run.

I did not get any message about the Compression or Password parameters.

The send mail was written by Tom Wickerath and I don't know if I should post
it all here? But I think that function works ok since I use it to send Word
documents.

Is there somewhere to set the compression parameters?

Thanks for the help!
 
G

Gina Whipp

Albert,

That line regarding the *compression parameters* is a copy/paste from the
module, so as far as I know the answer is No. Mr. Lebans has retired so I
am not sure of the plans on making that work. I would suggest taking that
out and seeing if the code runs... If yes then that is the problem, if it
still errors out then posting the code may be the only way to determine what
the issue is.

Is the code you got from Tom from his website? If yes then I am sure he
won't mind as long as his copyright line is posted as well.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
A

Albert S.

Ok, thanks. I tried the different calling methods, but the result was the
same. Here is part of the ErrorSignature message from Microsoft:

ModName: hpc6r6bu.dll ModVer: 0.3.1537.93

Once in a while I get an Error -1073741719 Automation error.

I will look into trying to stop the compression in the module.

Thanks for your help!
 
A

Albert S.

Ok, I searched for that problem dll and it is an HP printer driver. I removed
the printer it on one of the problem machines and it looks like the Report to
pdf it is going to run ok. We added the new printer around the same time, it
just didn't cross my mind that it would cause problems with Access. I'm going
to reinstall the printer and try to see if the error happens only when it is
the default printer.

Sorry for the bother! I'll post back if there is any other problem.
 
A

Albert S.

Removing the new HP printer as the default did the trick. That was why it
worked on some PCs and not others. They had a different printer as their
default. Now, what to do about the new printer...
 
A

Albert S.

I am going to go through a process this weekend. It is being used as a
network printer, but the drivers won't run on Server2003, so I have a
workstation filling in as the print server. HP has an app to check for
updates and it hasn't downloaded any, but I will try to go to HP's site and
see for myself.

The HP toolbox software caused a tremendous amount of "chatter" between the
workstation and our domain server, so I shut it down and only use the HP
update app. I'll let you know what I find out.

Thanks!
 
T

Tony Toews [MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top