[AccessD] Removing a filter from a report

William Hindman wdhindman at bellsouth.net
Mon Sep 29 03:23:00 CDT 2003


...nice explanation ...this goes in my scrap book :)

William Hindman
<http://www.freestateproject.org> - Do you want liberty in your lifetime?


  ----- Original Message ----- 
  From: A.D.Tejpal 
  To: Access Developers discussion and problem solving 
  Sent: Monday, September 29, 2003 12:33 AM
  Subject: Re: [AccessD] Removing a filter from a report


  Nancy,

      I have not seen any reply to your post so far. Certain points arising out of my experimentation on the subject are given below.

      When passing the filter criteria string as an argument while opening the report via DoCmd method, no need to  tinker with the filter properties of the report through any of its internal events. In any case whatever is done in the close event of the report does not necessarily get saved for next occasion.

      Following steps are recommended -
      (a) Open the report in design view
      (b) In the properties dialog box, make sure that -
          (i)  Filter is set to  Blank
          (ii) FilterOn is set to  No
      (c) Remove all statements reg filter properties (e.g Me.Filter = ""  and Me.FilterOn = False) from report's events.

      After the above steps, there should be no problem in getting proper response if the following statements are executed one after the other. (R_TEST is the name of report while Crs1 & Crs2 are criteria strings). The report should be in closed state before executing fresh statement -
  (1) DoCmd.OpenReport "R_TEST", acViewPreview, , Crs1 
  (2) DoCmd.OpenReport "R_TEST", acViewPreview, , Crs2
  (3) DoCmd.OpenReport "R_TEST", acViewPreview
        (Statement 3 means no filtering action)

      Note - To help appreciate what is happening  - Open the report as per (1) or (2) and then change its view to design view. On opening the property window, it would be observed that Filter property carries the value Crs1 or Crs2 as the case may be. FilterOn property continues as No. Do not click save button at this stage. When the report is finally closed and then opened in design view, the filter property will be found Blank.

  Regards,
  A.D.Tejpal
  --------------
    ----- Original Message ----- 
    From: Nancy Lytle 
    To: Accessd 
    Sent: Wednesday, September 24, 2003 14:53
    Subject: [AccessD] Removing a filter from a report

    I know this should be simple but I have tried everything I can think of....and it was pushed to the back burner and now it is on the hot plate again so...
    The problem is I have a few reports, which users choose from a form. This form allows the user to choose the report they want, the year (one year, ie 2003 or all years) for the data, and the dept  (either one dept. ie EDP or all depts), then a click of a button and the report opens for viewing with the selected records.  But what seems to happen on occassion is that a
    "filter" will stick to the report, thus making the next selection not work.

    I selected the reports using the good old stDocName for the report and stLinkCriteria for the filter, ie DoCmd.OpenReport
    stDocName,,,stLinkCriteria

    On the close of each report I use Me.filter = "" and Me.applyFilter = false

    What am I doing wrong?
    PS, I also have the same problem with forms when I want to open one report
    based on criteria from another form.

    TIA

    Nancy Lytle
    nancy.lytle at auatac.com
    202-314-1393



------------------------------------------------------------------------------


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030929/fae08c20/attachment-0001.html>


More information about the AccessD mailing list