Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


error in printing

Posted on 2014-09-29
Medium Priority
Last Modified: 2014-10-06
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
Printer.Print ""
Printer.PaintPicture Picture2.Picture, 0, 0, 12000, 12000
End If

Open in new window

When they click Yes, they get an error sometimes.  Is there  a better way to print Picture2?
Question by:al4629740
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
LVL 49

Expert Comment

by:Martin Liss
ID: 40350228
What error do they get?

Author Comment

ID: 40350481
I wish I could get them to write it down, but it is a runtime error.  I don't get an error.
LVL 49

Expert Comment

by:Martin Liss
ID: 40350649
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.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 40351135
Can I send the code to the database when An error occurs
LVL 49

Expert Comment

by:Martin Liss
ID: 40351150
You can do anything you want.

Author Comment

ID: 40357900
Can you provide a good example that would retrieve the error and send to db by chance
LVL 49

Accepted Solution

Martin Liss earned 2000 total points
ID: 40358179
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.
LVL 49

Expert Comment

by:Martin Liss
ID: 40364644
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question