Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Posts
    9

    Unanswered: access 97 checkboxes

    I have two groups of check boxes on a form. I have an All and a None and then a A, B, C D, E. If the user checks all, then they cannot individually check A..E. If they check None, they cannot check A..E. But they can check any combination of A-E and then cannot check All or None. How do I test for this in Access 97 I can't find an example anywhere! Please help.

  2. #2
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    I suppose you have named the check boxes: All, None, A, B, C, D, E.

    Sub All_AfterUpdate()
    Dim i As Integer
    For i = 65 to 69
    Me(Chr(i)) = True
    Me(Chr(i)).Locked = True
    Next i
    End Sub

    Sub None_AfterUpdate()
    Dim i As Integer
    For i = 65 to 69
    Me(Chr(i)) = False
    Me(Chr(i)).Locked = False
    Next i
    End Sub

    Sub NumberChecked()
    All.Locked = False
    None.Locked = False

    Select Case A + B + C + D + E
    Case 0 'none selected
    None = True
    All = False
    None_AfterUpdate

    Case -5 'All
    None = False
    All = True
    All_AfterUpdate

    Case Else
    All.Locked = True
    None.Locked = True
    End Select
    End Sub

    Sub A_AfterUpdate()
    NumberChecked
    End Sub

    Sub B_AfterUpdate()
    NumberChecked
    End Sub

    Sub C_AfterUpdate()
    NumberChecked
    End Sub

    Sub D_AfterUpdate()
    NumberChecked
    End Sub

    Sub E_AfterUpdate()
    NumberChecked
    End Sub

    Hope this helps,

    Dan

Posting Permissions

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