View Single Post
  #3  
Old February 24th, 2006, 07:32 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Help with checkboxes

It sounds as if a combination of option buttons and checkboxes would fit
the Windows UI guidelines better. Option buttons are intended for
situations where the user can only choose one of two or more options,
and checkboxes for where the options are independent of each other.

So maybe you need
Option group buttons for Morning, Afternoon, Evening
Checkboxes for Evening Extension and Special Booking
and code along these lines:

When Morning or Afternoon is selected, both checkboxes are disabled.
When Evening is selected, both checkboxes are enabled.
When Special Booking is checked, Evening Extension is automatically
checked.


In the option group's Change event, it would be something like this:
Select Case ogTimePeriod
Case 0, 1 'Morning,
ckEveExtension.Value = False
ckEveExtension.Enabled = False
ckSpecialEvent.Value = False
ckSpecialEvent.Enabled = False
Case Else 'Evening
ckEveExtension.Enabled = True
ckSpecialEvent.Enabled = True
End Select

In ckSpecialEvent_Change, something like this:

Me.ckEveExtension.Value = Me.ckSpecialEvent.Value

Depending on the exact behaviour you want, it may be better to use the
Exit or After_Update events instead of Change.


On Thu, 23 Feb 2006 13:10:28 -0800, Stibbz
wrote:

I have 5 checkboxes and I was wondering if I could make it so that when one
checkbox is ticked all the others can't or with some only certain ones can be
ticked

Morning
Afternoon
Evening
Evening Extension
Special Booking

When morning is ticked nothing else can be ticked
Same for afternoon
When evening is ticked only evening extension can be ticked aswell
And finally when special booking is ticked evening extension is ticked
automatically

If anyone could help I would be very grateful


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.