• Filter Checkboxes on Form (A97 SR2)

    Author
    Topic
    #429759

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #1001708

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

      • #1001792

        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.

        • #1002062

          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”?

          • #1002311

            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.

          • #1002885

            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.

    Viewing 0 reply threads
    Reply To: Filter Checkboxes on Form (A97 SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: