Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Red face Unanswered: How to apply filter to subform from button on main form

    I have a button on a main form that is supposed to apply a filter to the record source of a subform. I've tried

    dim frm as Form
    set frm = Forms![subname]
    with frm
    docmd.applyfilter "", "FIELD='value'"
    end with

    But I keep getting the error that Access can't find the subform, even though it's spelled correctly and does exist.

  2. #2
    Join Date
    Aug 2003
    Posts
    123
    Anyone have a response on this one?

  3. #3
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    How about this in the main form button click

    Me.SubFormControl.Form.Filter = "Field = 'Value'"
    Me.SubFormControl.Form.FilterOn = True


    MTB

Posting Permissions

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