Error handling stopped working

V

Vashfish

We have 5 different computers using access applications. My computer
spontaneously stopped switching between apps even though everyone
else's was working properly. The code uses On Error to catch when
AppActivate fails and then launches a new copy of the app it's
switching to. Unfortunately, on my computer, On Error Goto... seems to
have ceased functioning entirely. I made a short test function:

-------------------------------------
Function errorcheck() As String
On Error GoTo testerr
Dim s As Integer
s = 1 / 0

errorcheck = "None"
testexit:
Exit Function

testerr:
errorcheck = "Yay"
Resume testexit:
End Function
-------------------------------------

When I run it, it spits out a runtime error (division by zero) instead
of handling it properly. I tried reinstalling Access to no avail...
Does anyone have any idea how to fix this short of a complete office
reinstall?
 
R

RoyVidar

Vashfish wrote in message
We have 5 different computers using access applications. My computer
spontaneously stopped switching between apps even though everyone
else's was working properly. The code uses On Error to catch when
AppActivate fails and then launches a new copy of the app it's
switching to. Unfortunately, on my computer, On Error Goto... seems to
have ceased functioning entirely. I made a short test function:

-------------------------------------
Function errorcheck() As String
On Error GoTo testerr
Dim s As Integer
s = 1 / 0

errorcheck = "None"
testexit:
Exit Function

testerr:
errorcheck = "Yay"
Resume testexit:
End Function
-------------------------------------

When I run it, it spits out a runtime error (division by zero) instead
of handling it properly. I tried reinstalling Access to no avail...
Does anyone have any idea how to fix this short of a complete office
reinstall?

In VBE - Tools | Options - general tab -> Break on Unhandled Errors -
is it set to Break on all errors?
 
D

Douglas J Steele

Any time code that used to work stops working, or it works on one machine
but not another, the first thing to suspect is a problem with the References
collection.

All Access databases contain references to external files that they use. If
the same versions of the files don't exist in the same locations on the two
machines, you can run into problems. The specific function(s) causing
problems isn't indicative of which reference is the culprit, either.
References are like apples: one bad one can spoil the whole bunch.

On the machine(s) where it isn't working, open any code module, then select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

Post back if everything seems okay with the References.
 

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