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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error handling

Status
Not open for further replies.

ooops

MIS
Dec 21, 2000
91
US
Hi all,
This is what i have:

On Error GoTo errorCheck
sQuery = "SELECT * FROM web_app_v WHERE =500"
rsRecordset.Open sQuery, cnConnection

Exit Sub
errorCheck:
MsgBox (Err)

It's obvious that my query is wrong. What i want is if there's error with the query then go to errorCheck but it's not what's happening here. It never goes to errorCheck. I got the VB error msg: run-time error '-21472.... syntax error (missing operator) in query expressiong "=500" and ask me if i want to debug or end the application. Please help me to solve the problem. Users make mistake very often and the application should not die in such case. Thank you very much.
Helen Sincerely,
Bao Nghi
 
Try using the statement
"resume next "
after your msgbox in errorCheck .Actually it does go to the errorCheck flag and shows you the error message no as you want - but afterthat you need to tell it to skip that error.
hope it works
Anshu
 
Hi,

Thank you for your help. You're right, it does go to the errorCheck but only when i run it at other PC not mine. Strange! do you have any idea what might cause it ? Sincerely,
Bao Nghi
 
Hi,

I already found out why it did that to me. I have the option break on all errors instead of break on unhandled errors. Again, thank you. Sincerely,
Bao Nghi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top