Create a command button that runs the Filter By form function

G

Guest

I have a form that tracks all phone calls received - it has about 15
different fields on it that pertain to each call (who took the call, caller
name, what they wanted, etc.

Since the dept. will get 2000 calls a month, I need a way for them to search
easily and using any and all fields to perform the search. I know how to do
that using the Filter by Form function, however, they won't have that toolbar
available to them so how can I create a command button that will activate the
filter by form function instead?
 
R

Rick Brandt

Donna said:
I have a form that tracks all phone calls received - it has about 15
different fields on it that pertain to each call (who took the call, caller
name, what they wanted, etc.

Since the dept. will get 2000 calls a month, I need a way for them to search
easily and using any and all fields to perform the search. I know how to do
that using the Filter by Form function, however, they won't have that toolbar
available to them so how can I create a command button that will activate the
filter by form function instead?

DoCmd.RunCommand acCmdFilterByForm
 
G

Guest

Okay, I got that to work, but now how do I get it to execute the filter
without using the toolbar?
 
R

Rick Brandt

Donna said:
Okay, I got that to work, but now how do I get it to execute the filter
without using the toolbar?

Ooh...don't think you can except to perhaps assign an AutoKeys macro to a
specific keyboard key.
 
F

fredg

Okay, I got that to work, but now how do I get it to execute the filter
without using the toolbar?

You could create your own custom toolbar, with just the Toggle Filter
tool button.

In the Form Open event:

DoCmd.RunCommand acCmdFilterByForm
DoCmd.ShowToolbar "CustomToolbarName", acToolbarYes

In the form close event:

DoCmd.ShowToolbar "CustomToolbarName", acToolbarNo
 

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