Err.number

  • Thread starter Thread starter Norma
  • Start date Start date
N

Norma

How can I write a code to protect the error to do a
certain thing I want. Let say If err#2651 pop the program
will close a certain form.

Thanks
Norma
 
How can I write a code to protect the error to do a
certain thing I want. Let say If err#2651 pop the program
will close a certain form.

Thanks
Norma

Don't quite understand what you mean by "pop the program will close a
certain form.", but if you wish to run certain code if that error
occurs you would code the error handling section of your procedure:

On error GoTo Err_Handler

' Place your normal code here

Exit_this_Sub:
Exit Sub

Err_Handler:
If Err = 2651 Then
' Do something here
Else
' Do something else here
End if

** Don't forget to Resume someplace....
 
where should I place this code. Normally it will have
error when I click "Employee Button", so should I just
put it under "employee button".

Thanks again,
Norma
 
Back
Top