• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 123
  • Last Modified:

error in printing

I have a form that users are printing and sporatically they get a runtime error.  I think I narrowed it down to this section of code:

If MsgBox("Would you like to print this record?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
Me.PrintForm
Printer.Print ""
Printer.PaintPicture Picture2.Picture, 0, 0, 12000, 12000
Printer.EndDoc
End If

Open in new window


When they click Yes, they get an error sometimes.  Is there  a better way to print Picture2?
0
al4629740
Asked:
al4629740
  • 5
  • 3
1 Solution
 
Martin LissOlder than dirtCommented:
What error do they get?
0
 
al4629740Author Commented:
I wish I could get them to write it down, but it is a runtime error.  I don't get an error.
0
 
Martin LissOlder than dirtCommented:
Some thoughts:
What's different about your customer(s) with the problem? Different OS? Different printer?
Is it always the same customer?
Is it always the same picture?
There's code out there that you could add to your project that would send you an email containing the error information when the error occurs.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
al4629740Author Commented:
Can I send the code to the database when An error occurs
0
 
Martin LissOlder than dirtCommented:
You can do anything you want.
0
 
al4629740Author Commented:
Can you provide a good example that would retrieve the error and send to db by chance
0
 
Martin LissOlder than dirtCommented:
No I can't but if you are already writing to a database from the application then it should be easy to add a new table for the errors and in that table include things like the user's name, err.number, erl (the line number where the error occurred), and the name of the procedure where the error occurred. For help with the latter take a look at my Automatic Insertion of Procedure Names add in.
0
 
Martin LissOlder than dirtCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now