Command button in Filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form showing continous forms. I have a button at the top 'apply
filter'. When the form is loaded i have VBA setting filter by form to 'true'.
The problem is, is that this causes the apply filter button to be disabled.
How do I stop this?
I have removed all menus to become 'idiot proof' so they cant use the filter
menu which is why I am doing it this way.

Hope you can help,

James.
 
AFAIK, you can't enable a command button in FilterByForm view -
and I can't blame the authors of Access for wanting to avoid a myriad of
issues which might come up if you could...

Here are a couple of options for work-arounds:
1. Create a custom menu with just the buttons you want - FilterByForm,
ApplyFilter, and ClearGrid are a good basic selection. Display only this
custom menu.

2. Create an AutoKeys macro, e.g. ctl-A, which applies your filter. Put a
label on your form (I've used red for this) with a message like "Make your
selections on this page, then use ctl-A to see the results". Use the
form's OnApplyFilter to set the label's Visible property to False. If
you're going to offer another opportunity to move to FilterByForm view, make
sure your code also sets the label to visible.

HTH
- Turtle
 
Many thanks.

MacDermott said:
AFAIK, you can't enable a command button in FilterByForm view -
and I can't blame the authors of Access for wanting to avoid a myriad of
issues which might come up if you could...

Here are a couple of options for work-arounds:
1. Create a custom menu with just the buttons you want - FilterByForm,
ApplyFilter, and ClearGrid are a good basic selection. Display only this
custom menu.

2. Create an AutoKeys macro, e.g. ctl-A, which applies your filter. Put a
label on your form (I've used red for this) with a message like "Make your
selections on this page, then use ctl-A to see the results". Use the
form's OnApplyFilter to set the label's Visible property to False. If
you're going to offer another opportunity to move to FilterByForm view, make
sure your code also sets the label to visible.

HTH
- Turtle
 
I'm having problems with the autokeys. It keeps saying i need to type in the
name of the filter?

Is there a way to do it through VBA?
 
Autokeys must be a macro, although they can call code using RunCode.
However, in this case I think all you need is a RunCommand macro, with an
argument of ApplyFilterSort.

HTH
 
Back
Top