• Applyfilter – subform (Access 2003)

    Author
    Topic
    #425916

    I have a form with a subform and I’m trying to apply a filter on the subform. I have a button on the subform that uses this code when clicked:

    DoCmd.ApplyFilter , “[deleteit] = 0” (just trying to filter out records they have marked for deletion)

    This button works fine when I run the form that is used as the subform by itself, but when I try to run the main form and click on this filter button, I get the dreaded “Enter Parameter Value” window, and if I say “OK”, the whole screen goes blank.

    Not sure where to go with this one. Any suggestions would be greatly appreciated.

    Thanks in advance.

    Viewing 0 reply threads
    Author
    Replies
    • #982701

      Try replacing the line with

      Me.Filter = “[deleteit] = 0”
      Me.FilterOn = True

      Me refers to the form (or report) containing the code, i.e. the subform, so there can be no confusion.

    Viewing 0 reply threads
    Reply To: Applyfilter – subform (Access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: