O
Orlando
Hi I have a form with some text box in the Before_Update event of the key
filed I place this code
Private Sub EmpID_BeforeUpdate(Cancel As Integer)
If IsNull(Me![EmpID]) Or (Me![EmpID]) = "" Then
MsgBox "You must enter a Employee ID."
EmpID.SetFocus
Cancel = True
End If
End Sub
But let say I left empty the key field (EmpID) and I try to add the record,
in this case I got a system message Saying "Index or Primary key cannot
contain a null value" and the error # is 3058, how can I pick this error
number and sent a more a more friendly message instead of this system message.
thanks
filed I place this code
Private Sub EmpID_BeforeUpdate(Cancel As Integer)
If IsNull(Me![EmpID]) Or (Me![EmpID]) = "" Then
MsgBox "You must enter a Employee ID."
EmpID.SetFocus
Cancel = True
End If
End Sub
But let say I left empty the key field (EmpID) and I try to add the record,
in this case I got a system message Saying "Index or Primary key cannot
contain a null value" and the error # is 3058, how can I pick this error
number and sent a more a more friendly message instead of this system message.
thanks