By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,910 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

My error handler doesn't seem to work

P: n/a
Hi all,

I have a problem which I absolutely don't understand.
In my code I have implemented some error handling, but I still get a
runtime error. For example, I have the following code:

Sub x()
On Error GoTo xx
Dim a As Integer
a = 1 / 0
Exit Sub
xx:
Debug.Print "error"
End Sub

If I run this, I would expect the message (Error) to be displayed, but
instead I am confronted with a run-tim error.
What am I doing wrong?

Some additional version information:
MS Access 2000, SP3
VBA 6.0

Thanks in advance for any help
Bert
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Have you got 'Error Trapping' on the General Tab in
Tools|Options of the VBA editor set to 'Break on Unhandled
Errors'?

--
Nick Coe (UK)
AccHelp v1.01 Access Help File Builder
http://www.alphacos.co.uk/html/acchelp
Download Free Demo Copy

---

"Bert" <bo*****@freemail.nl> wrote in message
news:2c**************************@posting.google.c om...
Hi all,

I have a problem which I absolutely don't understand.
In my code I have implemented some error handling, but I
still get a
runtime error. For example, I have the following code:

Sub x()
On Error GoTo xx
Dim a As Integer
a = 1 / 0
Exit Sub
xx:
Debug.Print "error"
End Sub

If I run this, I would expect the message (Error) to be
displayed, but
instead I am confronted with a run-tim error.
What am I doing wrong?

Some additional version information:
MS Access 2000, SP3
VBA 6.0

Thanks in advance for any help
Bert

Nov 13 '05 #2

P: n/a
Hi Nick,

Yes! That's it! How stupid of me!

Thanks a lot.

Cheers,

Bert

"Nick Coe \(UK\)" <cl*****************@MASPON.yahooDOTcom> wrote in message news:<41***********************@ptn-nntp-reader03.plus.net>...
Have you got 'Error Trapping' on the General Tab in
Tools|Options of the VBA editor set to 'Break on Unhandled
Errors'?

--
Nick Coe (UK)
AccHelp v1.01 Access Help File Builder
http://www.alphacos.co.uk/html/acchelp
Download Free Demo Copy

---

"Bert" <bo*****@freemail.nl> wrote in message
news:2c**************************@posting.google.c om...
Hi all,

I have a problem which I absolutely don't understand.
In my code I have implemented some error handling, but I
still get a
runtime error. For example, I have the following code:

Sub x()
On Error GoTo xx
Dim a As Integer
a = 1 / 0
Exit Sub
xx:
Debug.Print "error"
End Sub

If I run this, I would expect the message (Error) to be
displayed, but
instead I am confronted with a run-tim error.
What am I doing wrong?

Some additional version information:
MS Access 2000, SP3
VBA 6.0

Thanks in advance for any help
Bert

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.