Filter query from Checklist box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yosiro
    New Member
    • Aug 2012
    • 34

    Filter query from Checklist box

    what code to make checklist on that form as a filter for the query?

    in criteria date i write Between [Forms]![Filter Form]![tb_DateBegin] And [Forms]![Filter Form]![tb_DateEnd]

    and its work!!!

    but i don't know how to write criteria using checklist on the form.

    All image in attachment
    Attached Files
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Using a checklist in the way you suggest is usually not recommended. You would need alot of work to expand the code to include more cities. However, if you are quite sure that you will not need to operate in more cities then those mentioned, then we/you can proceed with the intended approach.

    Your approach gets especially complicated since you want to convert a checkbox check to a comparision against a text field.

    Comment

    • yosiro
      New Member
      • Aug 2012
      • 34

      #3
      that's the point, because if we use the text field, the problem was solved, or do you have any suggestion how to filter some data instead write manually on query?

      Comment

      • TheSmileyCoder
        Recognized Expert Moderator Top Contributor
        • Dec 2009
        • 2322

        #4
        I would use a table of cities tbl_Cities with 2 fields, a primary KEY of type autonumber and a field with the city name. (One could add stuff such as postal code, or state but that is irrelevant for the question at hand)

        Storing the city name as plain text in each individual record breaks the rules of database normalisation.

        Comment

        Working...