how to remove filter sort

A

a

I have 2 form (form and subform) How can I remove filter sort from (sub
form) by using command button in main form

thank you
 
A

Allen Browne

Try:
Me.[Sub1].Form.FilterOn = False
replacing Sub1 with the name of your subform control.

That should work unless you have the main form filtered as well. If you do
Access gets confused. Details:
Incorrect filtering of forms and reports
at:
http://allenbrowne.com/bug-02.html
 
A

a

dear allen browne
Me.[Sub1].Form.FilterOn = False
doesn't do any thing (no thing happens)
any more help

Allen Browne said:
Try:
Me.[Sub1].Form.FilterOn = False
replacing Sub1 with the name of your subform control.

That should work unless you have the main form filtered as well. If you do
Access gets confused. Details:
Incorrect filtering of forms and reports
at:
http://allenbrowne.com/bug-02.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

a said:
I have 2 form (form and subform) How can I remove filter sort from (sub
form) by using command button in main form
 
A

Allen Browne

Okay, lets get more specific:
Was it a filter or sorting you wanted to remove?
You need to use OrderByOn for sorting.

If that doesn't work, is the form bound to a table/query?
Is the subform bound?
You can't use filters and sorting for unbound forms.

If that's still not the issue, open the Immediate Window (Ctrl+G) and ask
Access what's going on. For example, enter:
? Forms![Form1]![Sub1].Form.FilterOn
replacing Form1 with the name of your main form, and Sub1 with the name of
your subform control.

Finally, if you discover that the filtering/sorting is on in both the main
form and the subform, refer to the link.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

a said:
dear allen browne
Me.[Sub1].Form.FilterOn = False
doesn't do any thing (no thing happens)
any more help

Allen Browne said:
Try:
Me.[Sub1].Form.FilterOn = False
replacing Sub1 with the name of your subform control.

That should work unless you have the main form filtered as well. If you
do Access gets confused. Details:
Incorrect filtering of forms and reports
at:
http://allenbrowne.com/bug-02.html

a said:
I have 2 form (form and subform) How can I remove filter sort from (sub
form) by using command button in main form
 

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