Atleast one out of 4 check boxes required

  • Thread starter Thread starter sunilkeswani
  • Start date Start date
S

sunilkeswani

How do i make it mandatory to check atleast one of 4 check boxes?

one the form before update, I have the code for before update


If Me!CheckBox1.Value _
Or Me!CheckBox2.Value _
Then
' This record is okay.
Else
' This record is not okay.
MsgBox "Sorry, you must check at least one box among 1 OR
2"
Cancel = True
End If

How do I do the above for 4 ?

Please help

Cheers
Sunny
 
I use something similar on a Save button's on click event:

If me.checkbox1 = 0 OR me.checkbox2 = 0 OR me.checkbox3 = 0 OR me.checkbox4
= 0 Then
msgbox "Please Select SOMETHING!"
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End if
 
Ok great I got it

IF Me!Checkbox1 = True OR _
Me!Checkbox2 = True OR _
Me!Checkbox3 = True Then
ELSE
Msgbox "All checkboxes empty, please select one",vbokonly,"Checkbox
problem"
END IF

Thanks !
 
If (Me!CheckBox1 = True OR Me!CheckBox2 = True OR Me!CheckBox3 = True OR
Me!CheckBox 4 = True) Then
' this is OK
Else
MsgBox "You must check at least one check box."
' Put cursor at the first checkbox
Me!CheckBox1.SetFocus
End If

Sprinks
 
Back
Top