Error Not resetting

T

tig

Alright. This is just frustrating. We have an error handler built
into this VBA script and I would think it's being reset properly, but
when it finds another error we get a debug error. I've tried err.nbr
= 0. I've tried err.clear. Neither one works. What am I missing?
Any ideas greatly appreciated.

Private Sub Command14_Click()
'This procedure will check that the files being used are current. If
not a message
'will be displayed to the user.
.....
Dim i%
.....
On Error GoTo DiskErrorHandler

For i = 1 To 37 'loop thru all the files for dates and times

Select Case i
....
End Select


Next_Record:
Next i
........

DiskErrorHandler:
Select Case Err.Number
Case 53
MsgBox "File was not found." & Chr(13) & Chr(10) & Chr(13) &
Chr(10) & filename
Err.Number = 0 'clears error message
Err.Clear
GoTo Next_Record
Case 55
MsgBox "File already open."
Case 57
MsgBox "Possibly big problems on your hardware."
Case 61
MsgBox "The disk is full."
Case 64
MsgBox "Bad filename, naming conventions possibly not
followed."
Case 68
MsgBox "Device unavailable."
Case 71
MsgBox "Disk not ready - please check."
Case 72
MsgBox "Disk media error."
Case 75
MsgBox "Path/File access error."
Case 76
MsgBox "Path not found."
Case Else
MsgBox "Error # " & Err.Number & " (" & Err.Description & ")"
End Select

End Sub
 
D

Dorian

Did you try err.clear and then 'resume'.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top