PDA

Click to See Complete Forum and Search --> : error handle


arale
Jun 25th, 2000, 08:08 AM
ok lets say that i have an erron number '-2147467259(80004005)'; and i want to write :

on Err '-2147467259(80004005)'; GoTo idfixer

idfixer:
idfixer:
MsgBox "מספר ת.ז הינו קיים גבר במערכת אנא הכנס חדש"
txtid = ""
txtid.SetFocus



whats wrong here?

thank you for your help

MartinLiss
Jun 25th, 2000, 08:28 AM
You can't go to an error routine based on specific error numbers. Do something like this instead:

On Error GoTo ErrorRoutine

' your code

Exit Sub

ErrorRoutine:

MsgBox Err.Number & ": " Err.Description

End Sub

arale
Jun 25th, 2000, 05:51 PM
i know that i can do something just for this err number but how you describe the number

Clunietp
Jun 26th, 2000, 11:51 AM
On Error GoTo Error_Handler


Error_Handler:

Select Case Err.Number
case -2147467259
msgbox "Just what I thought!"
case else
msgbox err.description
end select