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

Correctly auto clear an error

Status
Not open for further replies.

Emblem1

Technical User
Jan 11, 2007
77
US
I want to clear an error message automatically, but not sure about the right way to describe it in the code. I am not to worried about fixing the code, but just want to ignore the error.


Err_Save_Changes_Click:
If Err = "Update or CancelUpdate without AddNew or Edit." Then
Err.Clear
End If
MsgBox Err.Description
Resume Exit_Save_Changes_Click

End Sub

I get a type mismatch instead.

Thanks.
 
Err should return a number, not the description. If you want to try to match the text of the err, try:
Code:
If err.Description  = "...." Then
Personally, I would stick with the numbers.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top