Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    1

    Unanswered: How to open a form with many different filters.

    Hello,

    I'm building a database that should be able to do this:
    When I start it I can select many check boxes, and when I press the open-button I want to get a filter so it shows the records matching the checks. I also want it to show machines that have other checks.

    I'll try to explain this better by givin an example:

    Store 1 sells:
    Milk
    Egg
    Coca Cola
    Coffee
    Soda

    Store 2 sells:
    Milk
    Egg
    Pepsi
    Soda

    Store 3 sells:
    Egg
    Coca Cola
    Pepsi
    Coffee

    Store 4 sells:
    Milk
    Egg
    Coca Cola
    Pepsi
    Coffee
    Soda
    Ham

    Ex. 1: When I select Milk, Egg and Coca Cola in the main window and press open I want a form to open with a filter that only show me Store 1 and Store 4.

    Ex. 2: When I select Pepsi and Coca Cola I want it to show me Store 3 and Store 4.

    I only want the checked items to count.

    Please could anyone help me solve this problem? I mainly need some sort of help with the OR command.

    Thank you in advance.
    Stefan Tabell, Sweden

  2. #2
    Join Date
    Sep 2003
    Posts
    228
    You can build a SELECT query in VB as the user checks/unchecks boxes. Then when they click open, you can set the RecordSource to that query.

    Or you build a filter statement as the user checks/unchecks(VB) and the then set the filter property of the form/report and finaly set the filteron property of the form/report to true.

    Either way, you are going to need some VB skills for this task.

    string = "SELECT Store from Table WHERE Product = ""Pepsi"" Or Product = ""Coke""

    me.recordsource = string

Posting Permissions

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