On Error trouble

R

Ronald

Hi all.
I do nothing fancy. I just want to raise an error to trap an impossible
situation, but no matter what I try, I can’t get ‘On Error GoTo <label>’
working.
I still get the default VBA error msgbox with the Stop, Debug and Help
buttons saying: Error 1000 during execution: Error generated by application
or object. (I have to translate it from Dutch so it won’t be 100% accurate.)
When I click Debug, the line ‘Err.Raise 1000’ is yellow.

I have put the ‘On Error GoTo <label>’ line at the start of the procedure
and just before the error generating code.
I have put ‘Err.Clear’ before the ‘On Error GoTo <label>’ line. Nothing works.

The last thing I tried, was to import the database into a clean database. It
didn’t help.

I’m using Office/Access 2007 (Dutch) on a Vista 64 (Dutch) computer.

What can be the matter?
Thanks for any answer.

Ronald.
 
A

Allen Browne

Suggestions:

1. In the code window, set Error Trapping to:
Break on Unhandled Errors
under:
Tools | Options | General

2. Make sure Use Special keys is checked under:
Office Button | Access Options | Current Database

3. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office 12\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
 
R

Ronald

Thank you very much, Allen.

The Error Trapping was set on All Errors and after the decompiling (and
again compiling) it worked like it should.

Ronald.
 

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