J
J Miller
I have the following code and error checking routine in my program:
===================================
Sub Test()
On Error GoTo tagErrorTrap
DBngine.CompactDatabase FILEA, FILEB
DBngine.CompactDatabase FILEC, FILED
Exit Sub
tagErrorTrap:
Select Case Err.Number
Case 3358 'database opened
Resume Next
Case Else
Msgbox Err.Number
Stop
End Select
End Sub
===================================
What is happening is the first time a specific error is encountered
the routine kicks in, handles it, and it works fine. But if the same
error occurs again in the program the routine is ignored like it
doesn't exist and my program is blowing up because the error is not
being handled.
In the code above if FILEA is opened the error handler works fine and
passes control to the next line, but then if FILEC is opened I get a
hard 3358 error because the error routine didn't do anything.
What am I doing wrong? Does something need to be reset??
Thanks in advance.
Jeff
===================================
Sub Test()
On Error GoTo tagErrorTrap
DBngine.CompactDatabase FILEA, FILEB
DBngine.CompactDatabase FILEC, FILED
Exit Sub
tagErrorTrap:
Select Case Err.Number
Case 3358 'database opened
Resume Next
Case Else
Msgbox Err.Number
Stop
End Select
End Sub
===================================
What is happening is the first time a specific error is encountered
the routine kicks in, handles it, and it works fine. But if the same
error occurs again in the program the routine is ignored like it
doesn't exist and my program is blowing up because the error is not
being handled.
In the code above if FILEA is opened the error handler works fine and
passes control to the next line, but then if FILEC is opened I get a
hard 3358 error because the error routine didn't do anything.
What am I doing wrong? Does something need to be reset??
Thanks in advance.
Jeff