Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2016
    Posts
    12

    Unanswered: Datasheet Filtering Does Clear From Report Memory

    I have a main form and a subform. The main form contains a button to print the data in the subform whether it's all of the data or filtered data. Data is filtered by utilizing the standard filter features for each column in datasheet view. There is also a clear button on the main form with the code below to clear the filtered subform.

    If I filter the data in the datasheet subform and click the Print button, the report opens in Print Preview with the correct filtered data. If I remove the filter by selecting the column header again and click "Select All" and then click the print preview button, the report displays showing all of the data. However, if the use the Clear button with the code below and then click the Print button, the report displays with the results of the last filter even though all of the data is showing in the subform again. How can I implement code that will mimic selecting each of the column headers and clicking "Select All" OR is there another way? There are 21 columns of data and it seems the easiest way to filter these is utilizing the standard filtering features in datasheet view.

    Code:
    DoCmd.RunCommand acCmdRemoveFilterSort
    Any help is greatly appreciated.

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    804
    Provided Answers: 2
    Hi

    I suspect your main form need to refer to the Subform Control's Form object, something like this

    Me.YourSubformControlName.Form.FilterOn = False

    I am not sure this will work with column filters active, but I don't se why not!!

    HTH

Posting Permissions

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