Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Use VBA to change a criterion

    Using VBA, how can I change a criterion in the source recordset of a subform? Example: change a criterion for a field from True to False.
    Many thanks.
    Last edited by sanora; 2015-01-26 at 16:06. Reason: misspelling

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Does using the Me.Filter command work?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes, it does, but only from within the subform. I was trying to effect the change from the main form using Forms!mainform!subform.filter and that does not seem to work. I can muddle on, but it is less elegant than I had hoped. Thanks for the response.

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Quote Originally Posted by sanora View Post
    Yes, it does, but only from within the subform. I was trying to effect the change from the main form using Forms!mainform!subform.filter and that does not seem to work. I can muddle on, but it is less elegant than I had hoped. Thanks for the response.
    I think you may also have to set .FilterOn = True
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts
    An option box in the subform header got the response I needed.
    Thank you all for your help. It is so very GOOD to know I have access to such a resource!
    Sanora
    Last edited by sanora; 2015-01-27 at 14:53. Reason: added the solution used

Posting Permissions

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