View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Smallweed Smallweed is offline
external usenet poster
 
Posts: 133
Default usform check boxes

(this forum's got a bit weird on the messages and I have to resend -
hopefully this isn't going to duplicate again!)

This does the trick (where chk3 is the "None of these" checkbox). At least
the separate myCheck routine cuts out some of the repitition:

Private Sub myCheck()
If Not chk1 And Not chk2 Then
chk3 = True
Else
chk3 = False
End If
End Sub

Private Sub chk1_AfterUpdate()
myCheck
End Sub

Private Sub chk2_AfterUpdate()
myCheck
End Sub

Private Sub chk3_AfterUpdate()
If chk3 Then
chk1 = False
chk2 = False
End If
End Sub


"Shawn" wrote:

Except now, you can't unclick any single selection. Once you click it, it
stays checked???
--
Thanks
Shawn


"Shawn" wrote:

If I add and "after event" action to change the appropriate box to true it
works. This just seems to add lenght to the code, though. Any better option?
--
Thanks
Shawn


"Shawn" wrote:

I was hoping for some quick simple solution. :)
--
Thanks
Shawn


"Smallweed" wrote:

These things are always fiddly. I find it usually involves looking at both
the OnClick event and the AfterUpdate event for the check box and juggling
around till it works. Good luck!


"Shawn" wrote:

I have a userform with several check boxes on it. Users can click as many as
appropriate. The last option is "None of these". If the user clicks any
check box other than the "None of these" it changes the value of "None of
these" to false. If the user clicks the "None of these" checkbox it changes
the value of all other checkboxes to false.

My problem is, for example, when the user clicks "None of these" it clears
the others but leaves the "None of these" option blank. You have to click it
a 2nd time to change its value to true????? I want one click to clear the
others and change the value of the "None of these" option to true. I know I
have a circular reference. How do I get around this?

If


--
Thanks
Shawn