Checkboxes

D

deltauser2006

Have a DB with a list of all 50 states. On a form I have each state
with a check box next to it. Above that I have regions listed with
checkboxes (ex. North East). What I want to do is when I click the
check box for "North East" all the checkboxes below it, which I set,
will be selected as well. In this example New York, Mass., New
Hampshire, Main etc will all be selected. The user then has the
ability to deselect those he doesn't want included or add others not in
the northeast if it is needed. Please help. Let me know if you need
any clarification.
 
L

Larry Linson

deltauser2006 said:
Have a DB with a list of all 50 states. On a form I have each state
with a check box next to it. Above that I have regions listed with
checkboxes (ex. North East). What I want to do is when I click the
check box for "North East" all the checkboxes below it, which I set,
will be selected as well. In this example New York, Mass., New
Hampshire, Main etc will all be selected. The user then has the
ability to deselect those he doesn't want included or add others not in
the northeast if it is needed. Please help. Let me know if you need
any clarification.

Databases aren't "about" Forms. They are about Tables and data -- Forms and
Reports just allow us to work with and view the data in the Tables. Often,
it is almost impossible to answer if we don't understand the Tables and
data.

What are you doing with the CheckBox information? Are they bound to Fields
in a Table or are they Unbound? Are any of the CheckBoxes in Option Groups?

Larry Linson
Microsoft Access MVP
 
D

deltauser2006

The checkboxes are bound to fields in a table. None of the checkboxes
are in option groups. The database holds the information of potential
investors based on their investment criteria. One of those criteria
is what state they invest in. Some invest in many, others in just
one. I don't see how that's relevant however. I am simply looking to
find out what I need to do within the form so that when someone clicks
on a check box a group of other boxes will be selected automatically.
(ex. if you select the mid-atlantic checkbox the DC, Maryland,
Virginia ect. checkboxes will be selected). Thanks
 
L

Larry Linson

deltauser2006 said:
The checkboxes are bound to fields in a table. None of the checkboxes
are in option groups. The database holds the information of potential
investors based on their investment criteria. One of those criteria
is what state they invest in. Some invest in many, others in just
one. I don't see how that's relevant however. I am simply looking to
find out what I need to do within the form so that when someone clicks
on a check box a group of other boxes will be selected automatically.
(ex. if you select the mid-atlantic checkbox the DC, Maryland,
Virginia ect. checkboxes will be selected). Thanks

It's relevant because, your description of the Form and Checkboxes implies a
Record with Yes/No Fields for each state and that is poor database design --
it violates relational database design principles; it would be better, for
good reasons, to have the State information in a related table
("normalized").

And, it'll be a pretty "busy" form, and my users don't like "busy" forms,
but to each his own.

However, if you are determined to do it this way (in the long run, you'll
regret it, when you need to query against the data), then in the AfterUpdate
of the "grouping checkboxes", you would include code to set on (or off) the
subsidiary checkboxes, for example, in the AfterUpdate of chkMidAtlantic,
you would have:

If Me.chkMidAtlantic = True Then
Me.chkDC = True
Me.chkMaryland = True
. . . 'other states you consider as Mid-Atlantic
Me.chkVirginia = True
Else
Me.chkDC = False
Me.chkMaryland = False
. . . 'other states you consider as Mid-Atlantic
Me.chkVirginia = False
End If

Good luck with your application, but don't expect a lot of sympathy when you
come back complaining about how difficult it is to Query for <whatevers>
with multiple states.

Larry Linson
Microsoft Access MVP
 
D

deltauser2006

Its the way the users wants it to be. Thanks for your help. It
worked perfectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top