Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreport filter

Status
Not open for further replies.

jflachman

Technical User
May 30, 2001
133
US
I don't seem to be able to set the filter or filteron properties in VB for a subreport.

I have tried doing it in the parent report Open event, the parent report Detail section format event and the child report Open event.

In all cases I get a Run-time Error 2101 - The setting you entered isn't valid for this property. Even if the only line of code is:

Me.FilterOn = True

However, the following line does not give me an error:
msgbox Me.FilterOn


What could I be doing wrong here?

Ultimately, I am trying to open a report from a form and display all the data for a given year in the subreport. What I'd really like to do is apply the following filter to the subreport:

me.filter = "AllocationYear = " & Forms![OpenAllocationReport].AllocYear
me.filteron = true

Help?

Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
As you have found, setting the filter property of the subreport at runtime is difficult if not impossible.

You can enter: [tt][blue]
Forms![OpenAllocationReport].AllocYear[/blue][/tt]
into the criteria of the subreport's record source.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top