Results 1 to 10 of 10
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Conditional cbobx (2002)

    Is it possible to control a cbobx based on a ckbx? On their form, they have cboTeamNo to select a team number (limit to list, tlkpTeamNo), but also blnDropped for members who have dropped out of training. If someone hasn't completed training, they have no business being assigned to a team. Hmm, what happens if someone is assigned to a team before they have completed training and then drops out? Maybe just a conditionally formated txtbx to warn that blnDropped is true and cboTeamNo is not null? I don't know!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Conditional cbobx (2002)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    No undrstd my babl? (You're in trouble Hans, because you do understand my babble).

    I kind of had something like that using Validation Rules (requerying the form was fun for me), but I ended up with an issue I couldn't resolve: If blnDropped is check before cboTeamNo, all is well. But, if cboTeamNo is selected before blnDropped, then the team number is already written to the table. Your solution works really well, except that I still have the issue of the team number remaining in the table if blnDropped was chosen after cboTeamNo.

    Did I 'splain that rite?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional cbobx (2002)

    The code I posted clears cboTeamNo if the user turns on blnDropped.

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Conditional cbobx (2002)

    Is that from the On Current event? If so, maybe it's because I already had code in there and "inserted" yours.
    <pre>Private Sub Form_Current()
    If [blnWarrior] = True Then
    [ImgWarrior].Visible = True
    Else
    [ImgWarrior].Visible = False
    End If
    Me.cboTeamNo.Enabled = Not blnDropped
    End Sub</pre>

    Did I mess that up by doing that?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional cbobx (2002)

    If you read my reply you'll see where the combo box is cleared (set to Null).

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Conditional cbobx (2002)

    Experiment1:
    Select cboTeamNo
    check blnDropped
    Result: cboTeamNo deactivated, but number still written to table.

    Experiment 2:
    Select cboTeamNo
    check blnDropped
    un-check blnDropped
    check blnDropped
    Result: cboTeamNo deactivated and previous team number removed from table.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional cbobx (2002)

    Edited by HansV to correct error

    Ys, it is psbl, bt all ths abbrvtns are hrd to rd.

    You could enable/disable the combo box based on the state of the check box.

    In the After Update event of the check box:

    Private Sub blnDropped_AfterUpdate()
    If Me.blnDropped = True Then ' originally had False
    Me.cboTeamNo = Null
    End If
    Me.cboTeamNo.Enabled = Not blnDropped
    End Sub

    and in the On Current event of the form:

    Private Sub Form_Current()
    Me.cboTeamNo.Enabled = Not blnDropped
    End Sub

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional cbobx (2002)

    Sorry, I mixed up things. I should have written

    If Me.blnDropped = True Then

    instead of

    If Me.blnDropped = False Then

    in the After Update event of the check box.

  9. #9
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Conditional cbobx (2002)

    Aha!!

    If Me.blnDropped = True Then
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  10. #10
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Conditional cbobx (2002)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>

    Our posts crossed each other! Thanks for the help Hans!!
    All is well!!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •