We help IT Professionals succeed at work.
Get Started

Is there a way to force a retry on error?

105 Views
Last Modified: 2020-02-14
I am using an access database to handle scanning orders into folders as a PDF.  

The scan function works great.  It drops the image into a local file as a jpg, no problem.  
I open the jpg(s) in a report, which works.
I close the report, using acSaveYes, and this seems to be working correctly.
Where I run into issues (at least on the AccessRuntime side of things) is in this line

DoCmd.OutputTo acOutputReport, "rptScan", acFormatPDF, "C:\TempScan\Report.pdf"

In the Runtime environment, I frequently get a 2046 error, and it stops.

If we rerun the process (sometimes multiple times) it goes through with the exact same results.

I added in a statement to try to get around this, by having it loop back to the portion of the code above in the Handle_err

    Select Case Err.Number
        Case 2046
            GoTo StartPDFConversion:  {the line above}
    End Select

Rather than loop, its still coming up with the 2046 error.    

I am using RT2013 as I was seeing too many bugs with RT2016.  

Is there a better way to force a retry of the PDF outputting code so that it just retries again?

Any help would be greatly appreciated.

Jeff
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE