Results 1 to 2 of 2
2006-11-29, 20:52 #1
- Join Date
- May 2002
- Florence, Oregon, USA
- Thanked 0 Times in 0 Posts
User error handling doesn't work (VBA Access2003/WindowsXP)
User error handling has suddenly stopped working in programs that have not been changed in months. As shown in the example below, the code all contains a "On Error Goto ErrorHandler" statement at the beginning of the applicable procedures, and the unchanged error handlers have all worked fine in the past. Now, when any error occurs, the "On Error Goto..." statement is ignored and control passes to the standard all-purpose VB error handler that displays "Run-time error 'nn': etc. It does not matter what error occurs, my error handlers are never given control.
As it was VBA for Access that was failing, I moved this code to the VBA for Excel environment. It also failed as described above. I even re-typed in the code; it still failed in all VBA environments.Then, as a last resort, I moved it to VB Express 2005. It worked fine. The following code example is the simplest way I could show the problem.
On Error GoTo ErrorHandler
Select Case Err.Number
Case 76 ' Path not found
MsgBox "Error number 76"
MsgBox "Else Error number " & Err.Number
Does anyone see where I could have created an environment where this failure would start happening? Or is there anything common to all VBA environments that, being corrupted, could be causing this?
Thanks to anyone who puzzles this out.
2006-11-29, 21:14 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: User error handling doesn't work (VBA Access2003/WindowsXP)
Does <post:=515,902>post 515,902</post:> help?