randolphoralph
Registered User.
- Local time
- Today, 04:17
- Joined
- Aug 4, 2008
- Messages
- 101
I have a command button that users click to add a new record. I wanted to add some code that will check the field UniqueID and Date to ensure that the field is not blank.
Here is what I have so far.
If I click the command button and either the UniqueID or Date field are blank a new record is added and no message box is displayed
Here is what I have so far.
Code:
Private Sub All_Load_Click()
If [UniqueID] = "" Then
MsgBox "Please enter Unique ID"
ElseIf [Date] = "" Then
MsgBox "Please enter Date"
Else
Me.AllowAdditions = True
DoCmd.GoToRecord acActiveDataObject, , acNewRec
Me.AllowAdditions = False
End If
End Sub
If I click the command button and either the UniqueID or Date field are blank a new record is added and no message box is displayed
Last edited: