Report Based on Filter of Form

(Make Report Show Same Records as Form {Using Filters})

home
From: Harrison, Larry [LarryH@APPLIEDIMAGE.com]
Sent: Monday, January 29, 2001 9:09 AM
To: 'larrytucaz@mindspring.com'
Subject: microsoft access, report based on filter of a form
This posting appeared on microsoft.public.access.reports. I was trying to fix a dilemma whereby a report which inherited the filter of a form was filtering the records even if the form's filter had been removed at the user-level. The problem I was having was that the only way to fix this was to open the form in "DESIGN" view and manually remove the filter under "DATA" properties. Here is the posting:
 
Check the FilterOn property of the form. Assuming the form is open and has a command button to preview the filtered records in a report, the button's Click [Event Procedure] could be:
 
  Dim strWhere as String
 
  If Me.FilterOn Then
    strWhere = Me.Filter
  End If
  DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
 
 
Note that Access correctly maintains the FilterOn property of
forms opened with a WhereCondition, but it does not correctly
maintain the FilterOn property of reports.
 
 
Larry R Harrison Jr wrote:
>
> I have a report that assumes the filter(s) applied to a certain form. I have
> noticed that if I apply a form but then remove it, the next time that filter
> gets saved with the form, and no matter what I do the report continues to
> execute that same filter even though the form itself doesn't. Thus, the
> report no longer accurately reflects what's on the form, the way it would if
> you were applying a NEW different at the time the form was open.
 
--
Perth, Western Australia
Tips for MS Access users at:
 http://odyssey.apana.org.au/~abrowne
Larry R Harrison Jr