You need to setup handling something like the following.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 2105 Then
MsgBox "You have entered an asset that already exists in the database!", vbInformation
Response = 0
Exit Sub
ElseIf DataErr = 3022 Then
MsgBox "You have entered an asset that already exists in the database!", vbInformation
Response = 0
Exit Sub
ElseIf DataErr = 3314 Then
MsgBox "You need to enter in a local and global asset number!", vbInformation
Response = 0
Exit Sub
ElseIf DataErr = 3101 Then
MsgBox "You have not entered a valid asset hierarchy, location hierarchy or manufacturer details!", vbInformation
Response = 0
Exit Sub
ElseIf DataErr = 3201 Then
MsgBox "You have not entered valid manufacturer details!", vbInformation
Response = 0
Exit Sub
End If
End Sub
In these, the error is intercepted & a 'friendly' message is given, depending on the error code produced. You can get these error codes by searching for error codes in the access help. Within here it has a couple of functions, which create tables containing the error codes....
Hope this helps James Goodman
j.goodman00@btinternet.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.