Hello,
I currently have the following code (gracious provided by PHV
) attached to an event on a particular field that works really well.
<BEGIN CODE>
Private Sub Shift_Exit(Cancel As Integer)
If Trim(Me![Shift] & "") = "" Then
Beep
MsgBox "Please select a Shift from the items listed.", vbOKOnly, "Shift Field"
Me![Shift].SetFocus
Cancel = True
Exit Sub
End If
End Sub
<END CODE>
I would like to add the same concept to a new record button. Prior to leaving the current record, I would like the user to be prompted with a message listing the fields that were not completed.
Example: A user completes his first and last name and leaves the shift, department and group fields blank.
I would like to attach the following message to the “Add Record” button to cover all fields prior to exiting the record.
Please enter the shift, department and group information before exiting record.
Any help would be appreciated.
I currently have the following code (gracious provided by PHV
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
<BEGIN CODE>
Private Sub Shift_Exit(Cancel As Integer)
If Trim(Me![Shift] & "") = "" Then
Beep
MsgBox "Please select a Shift from the items listed.", vbOKOnly, "Shift Field"
Me![Shift].SetFocus
Cancel = True
Exit Sub
End If
End Sub
<END CODE>
I would like to add the same concept to a new record button. Prior to leaving the current record, I would like the user to be prompted with a message listing the fields that were not completed.
Example: A user completes his first and last name and leaves the shift, department and group fields blank.
I would like to attach the following message to the “Add Record” button to cover all fields prior to exiting the record.
Please enter the shift, department and group information before exiting record.
Any help would be appreciated.