Hi guys
I'm trying to write a code that ensures at least one checkbox is ticked on a form. Any idea why it's not working?
Code:
Dim oCtr As Control
For Each oCtr In Me.Controls
If TypeName(oCtr) = "CheckBox" And oCtr.Value = True Then
'CODE HERE
Else
MsgBox "You must tick at least one."
Exit Sub
End If
Next
Thanks a lot!
James