Need help fixing error handler in access vba.
Posted on 2012-08-31
I have to error handlers followed by resume next that for some reason when it hits the resume next it goes back and loops through my errhndlr 3 times before moving on.
Here is the code;
On Error GoTo errhndlr1
myRec.Fields("DateProgrammed") = xlsht.Cells(8, "c")
MsgBox "Unable to convert " & xlsht.Cells(8, "c") & " to date format"
On Error GoTo errhndlr
myRec.Fields("DateLastRan") = xlsht.Cells(8, "e")
MsgBox "Unable to convert " & xlsht.Cells(8, "e") & " to date format"
In this code if either of these have errors it will go to the errhndlr and display the msgbox, then goes to Resume Next and then back to the msgbox above resume next 3 times before moving on to the next line of code.
Thanks in advance for the help!