Talismanic
Registered User.
- Local time
- Today, 17:01
- Joined
- May 25, 2000
- Messages
- 377
I have a form that tracks conversations between employees and superintendants at our company. I am trying to find a way to make sure that all three fields in the form are filled in before a new record is added. I have tried this a few different ways but can not get it to work. This is the last thing I tried:
Private Sub cmdNewRecord_Click()
If IsNull(Me.Conversation) Then
Beep
MsgBox "You can not leave the conversation box blank"
DoCmd.GoToControl "Conversation"
End If
If IsNull(Me.EmployeeName) Then
Beep
MsgBox "You can not leave the employee name box blank"
DoCmd.GoToControl "EmployeeName"
End If
If IsNull(Me.OfficeName) Then
Beep
MsgBox "You can not leave the office name box blank"
DoCmd.GoToControl "OfficeName"
End If
DoCmd.GoToRecord acForm, "EmpContactLog", acNewRec ' Starts new record.
End Sub
Any ideas?
Private Sub cmdNewRecord_Click()
If IsNull(Me.Conversation) Then
Beep
MsgBox "You can not leave the conversation box blank"
DoCmd.GoToControl "Conversation"
End If
If IsNull(Me.EmployeeName) Then
Beep
MsgBox "You can not leave the employee name box blank"
DoCmd.GoToControl "EmployeeName"
End If
If IsNull(Me.OfficeName) Then
Beep
MsgBox "You can not leave the office name box blank"
DoCmd.GoToControl "OfficeName"
End If
DoCmd.GoToRecord acForm, "EmpContactLog", acNewRec ' Starts new record.
End Sub
Any ideas?