applying filter to a subform

snoopy22

Registered User.
Local time
Today, 09:31
Joined
Oct 1, 2004
Messages
45
Hello everyone, i was managed to narrow down my problem, but still,
no solution... so with your premission i'll repeat it:

I've got a control tab with the folowing tabs:

1. subform name "personalInfo"
2. subform name "CompanylInfo"

i want the control tab to show the relevant records according to a filter
so i wrote this code at "on_open" event on "PersonalInfo"

docmd.applyfilter , sfilter '--sfilter is populated so it's not the problem

* the filter works just fine when i'm trying to open the "personalInfo" directly(not as a subform through the control tab)

my problem is when i'm trying to open it through the control tab,
i get the folowing massage:

"run-time error 2491:

the action ar methon is invalid because the form or report isn't
bound to a table or query"

can anyone please help me?? i've got this problem for a few days
and i just can't seem to solve it. for some reason there's a problem to
apply a filter from a sub form, please help!!
 
thank you for helping

i've managed to solve it, appearntly there's a problem to apply filter
on a subform, so i changed the sub form's recordsource in the on_open event

instead of

docmd.applyfilter ,sfilter

i wrote

me.recordsource= "select * from table where" & sfilter
 

Users who are viewing this thread

Back
Top Bottom