Filtering on a subform

  • Thread starter szag via AccessMonster.com
  • Start date
S

szag via AccessMonster.com

I have a simple option group in the (footer of a form) where I can click on
one of the options and it will perform a filter on the records - works fine
when I use it just in that form. But when I use the same option group choices
and same form as a subform it gives me a parameter box.

The problem seems to be that it doesn't understand what I am filtering on
when I use this form as a subform - I don't understand why it acts
differently just because it is embedded as a subform within another form.
 
S

Steve Schapel

Szag,

Can you please explain how the filtering is done? Is there a macro or
event procedure running? If so, what is the event that triggers it?
And what are the actions of the macro? Sorry, at this stage your
question is too vague for anyone to be able to help.
 
S

szag via AccessMonster.com

Yes the filtering is done with a macro. I click on one of the option group
choices which runs the macro which applies a filter to all records in the
"month" field (ie one of the choices is January, another choice is February,
etc.) Again the problem I am having is that when I test it (the form w/
macros) it works fine but when I use it as a subform it doesn't recogize what
I mean by "month". I think it is trying to apply the filter to the main form
even though the option group macro is in the subform. Does that help?

szag
 
S

Steve Schapel

Szag,

So, at a guess I would say that the macro is running on the After Update
event of the option group. Would that be right? And I suppose it could
be that the macro is using a SetValue action to modify the RecordSource
property of the form/subform. Is that right? If so, can you please
give the exact details of the Item and Expression arguments of the
SetValue action in the macro? And also the name of the form? And the
name of the subform? And the name of the option group? Thanks.
 
S

szag via AccessMonster.com

Yes the macro is running on the After update event on the option group. The
macro is not using the SetValue action. What I have is a conditional macro -
if the user selections January , the macro choose the condition and uses the
ApplyFilter action. The Where Condition for this filter is [month]=1(January).
Again the problem I am having is that it is applying this filter in the main
form (which obviously causes a paramenter box to pop up), not the subform but
I don't know why since the option group is in the subform. The name of the
form is "F_Master", subform "F_subUnits2", and option group "MonthFilter".
Does this help?
 

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