Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Create Printer Error for testing purposes

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Create Printer Error for testing purposes

    I have written an error handler for a "print" command button. The button prints several reports based upon the form with the "print" button. My code is to generate a VbRetryCancel message box if there is an error at the printer.

    I need to be able to generate something at the printer that will return an error so I can clear the error and attempt to retry in order to resume printing.

    Any suggestions, thanks in advance.

  2. #2
    Moderator mole999's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    9,855
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Create Printer Error for testing purposes

    physically turn it off, unplug the LAN, remove a colour cartridge, remove paper or add really thick paper to force a jam any of those should give you numerous errors
    • Yes I know there are better ways to do it. I just wish I knew them. - 97, 2003, 2007, 2010, 2013, 2016 & 2019
    • I wear my ignorance openly, excel is not my chosen career, its a means to an ends
    • Posting Guidelines Want to post well laid out questions and answers Translate Excel Versions
      Code:
      [CODE ]Put Your Code[/ CODE]
    • Settings > General Settings (on the left) scroll to the bottom, > Miscellaneous Options > Use ENHANCED
    • X-Posting Guidelines Rule 13 > CHART STUFF

  3. #3
    Board Regular
    Join Date
    May 2013
    Posts
    654
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    Can't you just Raise an error yourself.?

    https://docs.microsoft.com/en-us/off...p/raise-method
    Office 2007
    Access novice. Sometimes trying to give something back

  4. #4
    New Member
    Join Date
    Jun 2019
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    Quote Originally Posted by welshgasman View Post
    Can't you just Raise an error yourself.?

    https://docs.microsoft.com/en-us/off...p/raise-method

    Never heard of this. Than you, I will try.

  5. #5
    New Member
    Join Date
    Jun 2019
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    I had tried turning off and unplug LAN. These did not return an Access error. Access still printed and the print was in the Spool until I cleared the error on the printer.

  6. #6
    Moderator mole999's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    9,855
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Create Printer Error for testing purposes

    can you force it to print direct rather than spool the job ?
    • Yes I know there are better ways to do it. I just wish I knew them. - 97, 2003, 2007, 2010, 2013, 2016 & 2019
    • I wear my ignorance openly, excel is not my chosen career, its a means to an ends
    • Posting Guidelines Want to post well laid out questions and answers Translate Excel Versions
      Code:
      [CODE ]Put Your Code[/ CODE]
    • Settings > General Settings (on the left) scroll to the bottom, > Miscellaneous Options > Use ENHANCED
    • X-Posting Guidelines Rule 13 > CHART STUFF

  7. #7
    Board Regular
    Join Date
    May 2013
    Posts
    654
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    You can stop the spooler.
    Office 2007
    Access novice. Sometimes trying to give something back

  8. #8
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    16,474
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Create Printer Error for testing purposes

    Partly at least that's how printers work. It should actually print the job once the jam/paper problem/electrical supply is fixed (so you don't necessarily need to hit a print button again).

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  9. #9
    New Member
    Join Date
    Jun 2019
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    Thanks to all. I'm a novice and still have had no success.
    So far I have not successfully thrown an error to "fire" my error handler.

    I appreciate the help I'm getting.

  10. #10
    Board Regular
    Join Date
    May 2013
    Posts
    654
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Create Printer Error for testing purposes

    Well I expect the Raise function would do it? Wouldn't take a minute to test?
    Not something I've done I admit. I spend all my time trying to avoid them. :D
    Office 2007
    Access novice. Sometimes trying to give something back

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •