Thanks for your help - I am new to VBA syntax. I have found a nifty solution to addressing a required field on a form, I am just having a problem adapting it so that I can have more than 1 control. For reference, I have 8 checkboxes that must be checked off before the record can be saved.
The code:
I have an error that says End if without block if.
Thank you!
The code:
Code:
For Each ctl In Me.Controls
If Check1.Tag = "reqd" And Nz(Check1.Value, "") = "" Then MsgBox Check1.Name & " has not been checked off." & vbCrLf & vbCrLf & "Have you verified the correct date is shown?", vbCritical, "Error!"
ctl.SetFocus
Cancel = True
End If
Exit Sub
Next ctl
If Check2.Tag = "reqd" And Nz(Check2.Value, "") = "" Then MsgBox Check2.Name & " has not been checked off." & vbCrLf & vbCrLf & "Have you verified that the Location is correct?", vbCritical, "Error!"
ctl.SetFocus
Cancel = True
End If
Exit Sub
I have an error that says End if without block if.
Thank you!