A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with checkboxes



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2006, 10:10 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Help with checkboxes

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
  #2  
Old February 24th, 2006, 01:16 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Help with checkboxes

In the After_Update event of each checkbox put the code that sets the
state of every other checkbox. that you want to set to a given state.

HTH
--
-Larry-
--

"Stibbz" wrote in message
...
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



  #3  
Old February 24th, 2006, 08: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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add checkboxes with macro in Merge document? Bryan L Tables 3 October 19th, 2005 04:05 PM
Calculate Query and Checkboxes jackle Running & Setting Up Queries 0 August 2nd, 2005 12:13 PM
Dynamic Checkboxes Bari Samad Using Forms 2 June 25th, 2005 05:57 PM
Calculating Multiple Checkboxes with If Statements Playa Setting Up & Running Reports 2 December 20th, 2004 10:25 PM
Printing Problems involvong columns with checkboxes Greg General Discussion 1 August 22nd, 2004 10:13 PM


All times are GMT +1. The time now is 11:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.