Here is my code within the keydown event in a textbox named GUTS
If KeyCode = vbKeyReturn Then
KeyCode = 0
ElseIf KeyCode = "9" Then
If IsNull(Me.GUTS) Then
MsgBox "You must enter something within this field"
KeyCode = 0
End If
End If
After the user presses tab, without entering any data in this field, the message box is displayed. So this is working. But if they enter any data, hoping to move to the next field, the message reappears. Why?
If KeyCode = vbKeyReturn Then
KeyCode = 0
ElseIf KeyCode = "9" Then
If IsNull(Me.GUTS) Then
MsgBox "You must enter something within this field"
KeyCode = 0
End If
End If
After the user presses tab, without entering any data in this field, the message box is displayed. So this is working. But if they enter any data, hoping to move to the next field, the message reappears. Why?