Access2007 Filter mainfrom and subform and disply warning if filte

L

Louverril

I have a main form and a subform.

On the mainform I have a text box called CO_Filter and the following in the
forms oncurrent event : Me.CO_Filter.Visible = Me.FilterOn

On the subform I have a text box called CP_Filter and the following in the
forms oncurrent event : Me.CP_Filter.Visible = Me.FilterOn

The idea being that a text box is displayed when the data is filtered. I
want teh user to use the right click menu to filter.

This works fine when the forms open independently. But when they open as
they are intended to do - together- the subform's oncurrent event runs when
you right click the mainform to start a filter (before the mainforms
oncurrent event). This results in the two getting totally confused - if you
filter the main form, the subform text box ,CP_Filter, is made visible not
CO_Filter.

I've also tried putting the code in the ApplyFilter event and the same thing
happens the code jumps straight to the subform.

I'm going round in circles with this.

Any ideas how I can filter both forms - or at a pinch just the subform (if
you disallow filters on the mainform the subform also does not allow filters
- at least on a right click)

Please help Lou
 

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