Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter Checkboxes on Form (A97 SR2)

    I have a form "frmViewContractors" with 18 checkboxes.
    The checkboxes are used to designate if a contractor has a particular skill.
    I would like to be able to filter the records on the form so that the User could see the skills that they are looking for in a contractor.
    Then have a button to clear the filter.

    What is a good way to attack this problem?

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

    Re: Filter Checkboxes on Form (A97 SR2)

    You could teach the users how to Filter by Form (Data | Filter | Filter by Form or the equivalent toolbar button).

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Checkboxes on Form (A97 SR2)

    This application will be used by many users outside the department, thus a button(s) would be useful.
    I had a problem with a user the other day that did not know how to copy a file and they are a long time computer user.
    Trying to teach many users would be burdensome and ongoing as personnel are changing frequently.

    Thus I would like to do it with VBA.

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

    Re: Filter Checkboxes on Form (A97 SR2)

    You could create a separate unbound form with 18 check boxes, labeled identically to the check boxes on your bound form. Also put a command button on the unbound form that constructs a where-condition depending on the state of the check boxes, then opens the bound form with this where-condition. The where-condition depends on what exactly you want to do with the check boxes - does a "clear" check box mean "the person should NOT have this skill" or "I don't care whether the person has this skill or not"?

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Checkboxes on Form (A97 SR2)

    Sorry for the slow response, but I have been working on some other things.

    The Skill boxes denote if a Contractor has that skill. I want for users to be able to filter with buttons for the skill that they are interested in.

    I will try to implement your suggestions and get back with my solution.

  6. #6
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Checkboxes on Form (A97 SR2)

    This article on the Access Web shows another way of approaching this type of problem. I have to say I have never used it but it raises a few interesting thoughts.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  7. #7
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Checkboxes on Form (A97 SR2)

    I tried another approach. I created buttons for each Skill field and put SQL code behind it.
    Each Skill field is a Checkbox. I repeated the code for each skill field.
    For example for Asbestos Removal.

    Private Sub cmdAsbestosRemoval_Click()

    Dim strSQL As String

    strSQL = "SELECT * FROM qryEngineersReview WHERE qryEngineersReview.AsbestosRemoval = TRUE"
    Me.Form.RecordSource = strSQL

    End Sub

    Then I created a button to clear the filter.
    Private Sub cmdRemoveSkillFilter_Click()

    Dim strSQL As String

    strSQL = "SELECT * FROM qryEngineersReview"
    Me.Form.RecordSource = strSQL

    End Sub

    Thank you for your input.

Posting Permissions

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