Hi guys i got a form and sub form. When i leave the field hours empty in the sub form and try to click on close or some where in the form i get this error:
MsgBox "Primary key violation", , "Explanation"
instead of
MsgBox "Violation of Not Null constraint", , "Explanation"
i want to trap not null error and prompt the user that he has to enter value for hours field but aparently it does not. i be happy if some one help me fix this error .Thanks
picture of form in action:
http://i5.photobucket.com/albums/y18...nullerror1.jpg
http://i5.photobucket.com/albums/y18...nullerror2.jpg
code for on error :
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 3162
MsgBox "Violation of Not Null constraint", , "Explanation"
Case 3146
MsgBox "Primary key violation", , "Explanation"
Case 3155
MsgBox "Trigger violation: 'Wages of the employee in this project is not existed. You must enter data of hourly wage first'", , "Explanation"
Case Else
MsgBox "Other errors"
End Select
End Sub