Program error from command button (some pcs only)

P

Puzzled_Manchester

I have a form that uses a command button to open a report.
Well, it should open the report, but in fact crashes Access.

The most intriguing thing is that this happens on some pcs, but not others.
I have tried "compact and repair" and also creating a new database and importing the relevant objects, but the same is happening.

Any ideas?
 
B

Brendan Reynolds

My guess (and based on the information available, it can only be a guess)
would be a printer driver problem. See if you can find an updated printer
driver for one of the problem PCs, or if one of the PCs has more than one
printer installed, try changing the default printer. If you're opening the
report in preview mode, the printer doesn't even have to be attached to the
printer. Try the standard HP LaserJet driver that comes with Windows. Does
the report preview correctly with that driver? If so, you've identified the
source of the problem.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Puzzled_Manchester said:
I have a form that uses a command button to open a report.
Well, it should open the report, but in fact crashes Access.

The most intriguing thing is that this happens on some pcs, but not others.
I have tried "compact and repair" and also creating a new database and
importing the relevant objects, but the same is happening.
 
P

Puzzled_Manchester

Thanks, but the report works fine when accessed from the database window.
It only fails when accessed from the command button.

The error occurs on the line:
DoCmd.OpenReport stDocName, acPreview
Where stDocName is the report in question

It is an incredibly simple bit of code just as it appears from the command button wizard.
 
B

Brendan Reynolds

Can you a) post all the code in the command button Click event procedure and
b) describe what happens when the code fails?

And I still recommend the experiment of previewing using a different printer
driver on one of the problem PCs - it only takes a minute, and it might tell
us something useful.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Top