problem applying filter to a subreport in vba

G

Guest

I can't seem to get set the Filter property on a subreport using VBA.
Here is my code in the open event of the subreport

Select Case Parent.bytSrt
Case 1
Me.Filter="PersonNo < 4"
Case 2
Me.Filter="PersonNo > 3"
End Select

MSAccess errors with Err# 2101 "The setting you entered isn't valid fo this
property"

my record source is:
"SELECT * FROM tblSirPeople UNION SELECT * FROM tblTempPeople"
and PersonNo should be a valid field
 
G

Guest

I have the same problem, I'm working out to find a solution. But I haven't
still found it.

Can anybody helps?

Dario.
 
G

Guest

I endded up abandoning this way of accomplishing it and created a variable in
the main report (in vba) that keeps track of which subreport is current. In
the subreports open event i incremented the variable and set the subreport's
record scource accordingly in vba
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top