Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

automatically selecting a category with yes/no boxes

Discussion in 'Information Technology' started by Lee, Jul 28, 2006.

  1. Lee

    Lee
    Expand Collapse
    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
     
  2. jmonty

    jmonty
    Expand Collapse
    Guest

    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
     
  3. Lee

    Lee
    Expand Collapse
    Guest

    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?

    "jmonty" wrote:

    > 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
    > .
    > .
    > etc.
    >
    >
    > Do this for each of the child checkboxes.
    >
    > jmonty
    >
    >
    > "Lee" wrote:
    >
    > > 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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page