G
Guest
I have the following BeforeUpdate event happening on a form
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[ObjectNum]) = True Then
MsgBox "This field is required. Please Enter"
Me.[ObjectNum].SetFocus
Cancel = True
End If
End Sub
Person comes to form, enters data and closes the form with a Button Control.
The even above shows up in the form's beforeUpdate property
The field is left blank. The user closes the form. The msg box shows up
fine. But when one choosees OK, it pops up again. After the seconfd time, the
form closes.
I was expecting the form to pop up message, choose OK, have focus placed on
required field, and enter the missing data.
What am I missing.
Thanks alot!
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[ObjectNum]) = True Then
MsgBox "This field is required. Please Enter"
Me.[ObjectNum].SetFocus
Cancel = True
End If
End Sub
Person comes to form, enters data and closes the form with a Button Control.
The even above shows up in the form's beforeUpdate property
The field is left blank. The user closes the form. The msg box shows up
fine. But when one choosees OK, it pops up again. After the seconfd time, the
form closes.
I was expecting the form to pop up message, choose OK, have focus placed on
required field, and enter the missing data.
What am I missing.
Thanks alot!