Adding a button to request a filter (1 Viewer)

Juliaataccess

New member
Local time
Today, 22:54
Joined
Mar 28, 2013
Messages
3
Hi,

I have a form and want to filter records on demand, as each time the filter will be based on a different set of criteria.

It works well, execpt that the user has to remember to go to the Ribbon or the Quick Access Toolbar to click on the "Filter" button so they can choose the relevant filter criteria - usually from the Organisation Type and Borough fields - eg. Carers in Tower Hamlets.

I have struggled to find a way to put a button for this option into the form. I'd like one to appear beside these 2 main filtering fields so the user can click inside the field and click on this, instead of having to remember to go to the Ribbon or Quick Access Toolbar for it.

Can you help me with this query ?


Regards,
Julia
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:54
Joined
Feb 19, 2013
Messages
16,553
Is the object you are trying to filter a subform?

If so then either in the onchange event for each combo or if you want a button, in the button on click event put code similar to this

Code:
YourSubFormName.Form.Filter = "[SomeField] = " & combo1 & " AND [SomeOtherField] = " & combo2
YourSubFormName.Form.FilterOn=true

If the values in your combo are text then substitute

" & combo2 with '" & combo2 & "'"
 

Users who are viewing this thread

Top Bottom