Hi,
This problem has been bugging me for a while. In my form's before update field i have the following code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Nominator_name = "" Or IsNull(Me.Nominator_name) Then
MsgBox "Please fill in your name", vbCritical + vbOKOnly + vbDefaultButton2, "MISSING DATA"
Me.Nominator_name.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If Me.Nominee_name = "" Or IsNull(Me.Nominee_name) Then
MsgBox "Please choose an award nominee", vbCritical + vbOKOnly + vbDefaultButton2, "MISSING DATA"
Me.Nominee_name.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If Me.List30 = "" Or IsNull(Me.List30) Then
MsgBox "Please choose an award category", vbCritical + vbOKOnly + vbDefaultButton2, "MISSING DATA"
Me.List30.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
End Sub
I also have a macro running on my command button which closes the current form and opens another. When i press the command button and the form has a null field the macro still runs and produces an error message.
How do i get the macro to stop running if the verification fails????!!!!?????