Re: if any checkbox.value = 1 then (solved)
Thank you. Very useful. It took me a few goes but I managed to modify the code to whats below and from that managed to get the code to exit the routine if any checkbox was checked(ticked). Thank you again Smiler44
Private Sub Command1_Click()
' this code will look at checkbox 1 and 2. if one of them is checked then
' a message box is displayed. if both are checked then message box displayed twice
Dim Check1, Check2
Dim checkbox
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is checkbox Then
If ctl.Value = 1 Then MsgBox ("1")
End If
Next ctl
End Sub