Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter (Access 2003)

    I have a form with 2 subforms. I have set up a command button so that a user can filter - but it only allows a filter on the main part of the form not the 2 subforms. How can I set it up so that it would also allow the user to filter by either of the subforms?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Filter (Access 2003)

    Hi Robin

    Just seeking clarity here, so excuse the further questions. Can I assume:

    1) The macro/VBA code to the button is in a module?
    2) In the subforms will you be filtering on similar fields?

    and as a note of opinion, without seeing your design, I am just a little worried having filters on these areas , how do you clear them after use?
    Jerry

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Filter (Access 2003)

    In addition to Jerry's questions, what is it you're trying to filter. If the subforms are linked by master/child links, they're filtered automatically by any filter applied to the parent form. If you're trying to filter the parent from the subform, why?
    Charlotte

  4. #4
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter (Access 2003)

    I guess I didn't explain this very well. I have a form that has a command button that the user can click on and activate the Filter by Form option. From the form the user can select anything on the main form and click apply filter and it filters for the main form and the 2 subforms. What I would like the user to be able to do is click the command button then be able to click into either of the 2 subforms make a selection or set criteria then click apply filter.
    thank you in advance to all that can help

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Filter (Access 2003)

    In what format are the subforms?

    If you have then as a single or continuous form you can put a filter button on them but if it is datasheet, you can't
    Jerry

  6. #6
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter (Access 2003)

    Yes, they are datasheet view.

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

    Re: Filter (Access 2003)

    Why do you need a command button for the Filter By Form option? There is a toolbar button for it. You could create a custom toolbar for your form and subforms with the Filter by Form button (and others) to make sure that it is always available.

  8. #8
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter (Access 2003)

    I thought it would be easier for the person using the DB to have a button that they could click. I can do the toolbar but I'm still not sure how to get the filter on subform. When I try - it just filters the subform.
    thanks
    Robin

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

    Re: Filter (Access 2003)

    Filter by Form affects only the form that has the focus when you invoke it. If the focus is on the main form, the main form will be filtered, and if the focus is on one of the subforms, that subform will be filtered (without any effect on the main form). If you want to filter the main form at the same time as the subform, you'd have to create your own form for it, and write lots of code.

  10. #10
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter (Access 2003)

    Thanks Hans - don't know how to write code so will have to do with what I have.

Posting Permissions

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