My problem is I am using this code and MsgBox show up one after other however I want it show first popup for name and then person fills that info and next popup I don't know what I am missing in the code. Please help. I have a form on which people fill half info and scroll forward and open a new record so I am trying to block them doing so.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim YourName As String
Dim cboCenter As String
If IsNull(Me.[YourName]) Then
Cancel = True
MsgBox "You must provide Name"
If (Me.[YourName]) <> "" Then
Exit Sub
End If
End If
If IsNull(Me.[cboCenter]) Then
Cancel = True
MsgBox "You must provide Center"
If (Me.[cboCenter]) <> "" Then
Exit Sub
End If
End If
End Sub