automatically selecting a category with yes/no boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I'm new to Access to bare with me.

I'm trying to create a form where I would have a list of probably 8 yes/no
questions and if even one of that list is chosen it would automatically check
yes on larger umbrella category.

An example:

INFANT HEALTH
Immunizations (yes/no box)
Newborn visit (yes/no box)
Illness (yes/no box)
Lead (yes/no box)
Other (text)

So if any of the lower case categories were checked it would automatically
check Infant Health as a the larger umbrella category. There are seven
umbrella categories with a maximum of 9 lower choices. I can't do a drop down
menu because I need to be able to check multiple (larger and smaller)
categories on the same form.

Thanks so much!

Lee
 
For our example here, your "lower case categories" = Child
and "Umbrella" = Parent.

ParentCheckBox
Child1
Child2

Use the Child's Change event to update the Parent check box:
Select each child checkbox (in design mode) and right-click. Select Build
Event > Code Builder. Enter code similar to the following:

Private Sub Child1_Click()
If Me.Child1 = True then
Me.ParentCheckBox = True
Else
Me.ParentCheckBox = False
End If
End Sub

Private Sub Child2_Click()
If Me.Child2 = True then
Me.ParentCheckBox = True
Else
Me.ParentCheckBox = False
End If
End Sub
 
That's amazingly helpful. Thank you so much.

Can you tell me what the code would look like if it were a text box instead
of a check box?
 

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

Back
Top