My records are displayed in a datasheet view. If the user updates the Status combo box to a specific value, he needs to add in text in the Notes fields before moving onto the next record.
I've got the following code in the form's Before Update event:
And in the Notes field's Lost Focus event:
But this still allows the user to move the focus to the next record. I would like to force him/her to enter text in the notes field if the status has been updated, no matter what.
How can I achieve this?
I've got the following code in the form's Before Update event:
Code:
If (Me.NewRecord) Then
Exit Sub
ElseIf Nz(Me.cboDataStatus.OldValue, "") <> Nz(Me.cboDataStatus, "") And (IsNull(Me.Creation_Notes) Or Me.Creation_Notes = "") Then
MsgBox "Please enter a reason in the note field for why this record's status has been updated.", vbInformation, "Creation Note"
Me.Creation_Notes.SetFocus
End If
And in the Notes field's Lost Focus event:
Code:
If IsNull(Trim(Me.Creation_Notes)) Or Trim(Me.Creation_Notes) = "" Then
MsgBox "Please ensure the necessary text has been entered into the Notes field.", vbOKOnly, "Please enter a note"
Me.Creation_Notes.SetFocus
End If
But this still allows the user to move the focus to the next record. I would like to force him/her to enter text in the notes field if the status has been updated, no matter what.
How can I achieve this?