Question wizard not working when adding filter buttons. .

alexlds

Registered User.
Local time
Today, 09:47
Joined
May 28, 2012
Messages
71
Hi - I seem to be having a problem with access 2007

When I use the filter by form, filter by selection, and toggle filter buttons located on the ribbon, they work normally on my form, in the usual way.

However when I use the button wizard to add the various available filter buttons to my form, it adds the buttons with the correct graphics on - but in form view clicking on the buttons does not actually do anything.

Ive tried running compact and repair but still the same.

Any ideas??
 
Ive also tried turning off antivirus which was suggested elsewhere but that dosnt help either
 
I'm using 2010 presently, so I'm not sure what button wizard you are referring to.

You can build a filter button from scratch easily. Use the button wizard to place a button on your form, but cancel the wizard. Go to the expression builder for the on-click event and invoke a filter with something like:

Code:
Me.Filter = "FieldB = 'bbb'"
Me.FilterOn = True
You didn't say much about what or how you're trying to filter, but this should get you started.

(You'll need another button to turn the filter off . . . . Me.FilterOn = False)
 
Last edited:
Is the db in trusted location? If not, have you enabled it when it asks at startup?
 
Hey thanks for that !

All I want to do is get buttons on the form that function in exactly the same way as the ribbon buttons for "Filter by Form", "Filter by Selection" , "Toggle Filter on n off" and "Clear all filters".

The code you gave me will be fine - but it requires me to specify within the code which particular field I want to filter on - whereas the ribbon buttons dont.

How would I get around that?
 
This will get you part way. I don't know how to replicate what you get filter-wise from the ribbon. One thing you can do is to put a button on your form that runs

Code:
DoCmd.RunCommand acCmdFilterByForm
This will put your form in a mode where you can select the filter using a dropdown selection on your field(s). You then have to right click and apply the filter or toggle the filter from the ribbon. I don't know how to invoke toggling the filter via vba, as other controls on the form are disabled when the form is in the filter mode.
 

Users who are viewing this thread

Back
Top Bottom