Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Error Goto Not Working

Status
Not open for further replies.

coolscan3

Programmer
Oct 23, 2001
40
0
0
GB
I have the following Code:

On Error GoTo Err_Handler

Dim db As Database
Dim rst As Recordset

Set db = CurrentDb

Set rst = db.OpenRecordset("select * from tSample where sftshift='K'")

MsgBox (rst!wodref)

Exit sub

Err_Handler:

MsgBox ("Error")

A "no current Record" error is deliberatltely generated
The msgbox after the Err_Handler does not appear and the code stops at the msgbox

Does not appear to be seeing the On Error Statement. This suddenly seems to be happening on all previously written databases
 
Anyway, I'd test the BOF and EOF properties of rst ...
 
If you go into the VB editor and then go Tools-->Options General tab, what setting do you have in the Error Trapping frame?

I would expect this to happen if it's set to 'Break on all errors'.

Hope this helps

HarleyQuinn
---------------------------------
You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Wow, I was incredibly late on that one! [blush]

HarleyQuinn
---------------------------------
You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top