G
Guest
I am having trouble setting my Customerid field on my form to stay as the
focus. The if statements all execute.
When I choose vbYes in the MsgBox (“You Must Enter a Customer to Continue",
vbQuestion + vbYesNo <> vbNo) the procedure simply carries on to the next
statement.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNothing(Me!CustomerID) Then
If MsgBox("You Must Enter a Customer to Continue", vbQuestion +
vbYesNo <> vbNo) Then
CustomerID.SetFocus
Cancel = True
Else: Exit Sub
End If
End If
If MsgBox("Save changes?", vbOKCancel) <> vbOK Then
Me.Undo
MsgBox "Changes were not Saved."
Cancel = True
End If
End Sub
Any help would be appreciated
focus. The if statements all execute.
When I choose vbYes in the MsgBox (“You Must Enter a Customer to Continue",
vbQuestion + vbYesNo <> vbNo) the procedure simply carries on to the next
statement.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNothing(Me!CustomerID) Then
If MsgBox("You Must Enter a Customer to Continue", vbQuestion +
vbYesNo <> vbNo) Then
CustomerID.SetFocus
Cancel = True
Else: Exit Sub
End If
End If
If MsgBox("Save changes?", vbOKCancel) <> vbOK Then
Me.Undo
MsgBox "Changes were not Saved."
Cancel = True
End If
End Sub
Any help would be appreciated