Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check box groups 1

Status
Not open for further replies.

assiri

Technical User
Aug 17, 2008
17
0
0
GB
I have to create six sets of checkbox groups in a MS Access 2003 form
ex: set1 , se2 ,set3 ,set4, set5 , set6

each set has four check boxes
ex:set1 has 4 check boxes
set 2 has 4 check boxes
set3 has...
etc..
(all together there are 24 check boxes)
One or more check boxes can be selected within a group,
ex: one,two,three or all the check boxes can be selected in one group
but goups are mutually exclusive.I am thinking to use an event handler in a class module, still couldnt achive.please send me some code or any other vba method.
Thankx

 
groups are mutually exclusive"
You will have to explain what that means.

Typically, the controls within a single group might be mutuallly exclusive if they are radio/option buttons.

But mutually exclusive groups doesn't make sense.
Perhaps you are saying that the Kth box in each group is mutually exclusive with the Kth box in the other grops? (i.e. can't select the Kth box in 3rd group if the Kth box in 2nd groupis selected)
 





Hi,

Use OptionButtons to ENABLE the appropriate checkbox group. Option Button ARE mutually exclusive in a group.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
hi,

sorry for insufficent information

-There are six sets of checkbox groups ,each group having 4 check boxes.(Group1,Group2,Group3,Group4,Group5,Group6)

-Group1 has four checkboxes(check1,check2,check3,check4)
Group2 has four checkboxes(check5,check6,check7,check8)
Group3 has four checkboxes(check9,check10,check11,check12)
Group4 has four checkboxes(check13,check14,check15,check16)
Group5 has four checkboxes(check17,check18,check19,check20)
Group6 has four checkboxes(check21,check22,check23,check24)


-we should be able to select more than check boxes in a group
we can select one,two,three or all the check boxes in a perticular group
ex:
say(1):we should be able to select three check boxes ingroup3
check9,check10 and check11
(2)we should be able to select two check boxes in group6
check21,check22
-But we cant select checkboxes in two different groups simultaneously
ex(1):if we have selected two checkboxes in group one, when we select a checkbox in group two, groupone checkboxes should be cleared
ex(2)if we have selected three checkboxes in group three ,when we select a checkbox in group6, group three checkboxes should be cleared
ex(3)if we have selected one checkbox in group one,say if we select a checkbox in group four,groupone checkbox should be cleared
pls give some method.Thankx
 
As soon as you use the word "should", it becomes a matter of pure logic. Work it out. Decribe it precisely, and then write the appropriate logic code to handle it.

Are these in frames? Are they in their own frames?

Radio (Option) buttons are grouped, but checkboxes are not. Therefore, you can check multiple checkboxes, or at least that is the way it normally works.

You are also not being totally clear, or rather it seems there is a contradiction.

"-But we cant select checkboxes in two different groups simultaneously"

my bolding

That sounds like...you "cant" [sic], that is, you are not able to.

YET......

"ex(1):if we have selected two checkboxes in group one, when we select a checkbox in group two, groupone checkboxes should be cleared"

Which sounds like you want it to be exclusive; you want it to act so multiple groups are not possible. It is that "should" word.

Again, work out precisely, exactly, what is the logic. I have no doubt that code can be written that will cover that logic.




faq219-2884

Gerry
My paintings and sculpture
 
I think the logic is the same as Skip had foreseen. Summed up as follows:

"cant select checkboxes in two different groups simultaneously
 
Well I don't know about that.

Firstly, as stated, I can select checkboxes in two different group simultaneously without any problems whatsoever.

The OP says they "cant" [sic]. I most certainly can. I just did it.

Secondly, I just did the following:

"if we have selected two checkboxes in group one, when we select a checkbox in group two, groupone checkboxes should be cleared"

Specifically, I made it so that if a checkbox is checked in GroupB, then all the checkboxes in GroupA are cleared. This is, again, a matter of logic.


Thirdly, Skip did NOT "foresee" anything of the kind. Skip did not even mention checkboxes. He only mentioned (correctly of course) that Option Buttons are mutually exclusive in a group.

I am suggesting that whatever rules that the OP requires are rules of logic, which are NOT stated clearly.

faq219-2884

Gerry
My paintings and sculpture
 




The implication of my suggestion was to control the checkbox group exclusivity, using option buttons.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip...huh?

Do you mean adding option buttons exclusively to control checkboxes?

That is, groups of checkboxes, AND OptionButtons that control how the groups function?

Seems odd.

faq219-2884

Gerry
My paintings and sculpture
 



Yup! Isn't that what the OP is wanting?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I'm sure input from the OP is better than from me. But everything he wrote is consistent with the fact that the groups are mutually exclusive (we can never have boxes checked in more than one group at a time).

He makes one ambigous statement that "we cant select checkboxes in two different groups simultaneously", but he immediately follows with clarifying examples that this would un-select the boxes in the previous group. I wouldn't call this simultaneous selection, but the examples make it clear what he means.
 
Sorry, forget my 2nd paragraph above where I got a little confused, but I stick by my first paragraph.
 




"...but he immediately follows with clarifying examples that this would un-select the boxes in the previous group. "

This is what a set of option buttons could do. Each option button enabling one checkbox group and disabling/clearing every other checkbox group.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top