I expected this code to trigger when a user decided to navigate to another record. Instead, it triggers as soon as the text box is entered. Is there an event that will not trigger as soon as a user enters a text box?
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo err_B4Update
Dim boolFixThis As Boolean
Dim strPleaseDo As String
boolFixThis = False
strPleaseDo = "Please do the following before saving this record: " & NP
If Me.Dirty = True Then
If IsNull(Me!cboCategory.Value) Then
strPleaseDo = strPleaseDo & "* Select a category from the drop down box in step 5."
boolFixThis = True
End If
If IsNull(Len(Me!cusname.Value)) Then
strPleaseDo = strPleaseDo & vbCrLf & "* Enter a phrase name in the green box "
boolFixThis = True
End If
If IsNull(Me!cboPhraseEnteredBy.Value) Then
strPleaseDo = strPleaseDo & vbCrLf & "* Select the name of the person entering this phrase." & vbCrLf & "HINT:Double-click on the drop-down box if you need to enter a name."
boolFixThis = True
End If
End If
If boolFixThis = True Then
MsgBox strPleaseDo, , "Additional information needed."
Cancel = True
End If
Exit Sub
err_B4Update:
ErrBox "validating information before commiting to the database in frmPhrasesAdmin_Form_BeforeUpdate"
End Sub