Is there code available for filter by selection...?

B

Brian

I've seen just about everything I need in reference to
servertype filters and filterbyform, but nothing for
applying a filter by selection (if it's available and if
so, how it's used). I've even tried using
"DoCmd.DoMenuItem acFormBar, acRecordsMenu, 0, 1,
acMenuVer70" to trigger the event myself to no avail. I
receive an error that "the command or
action 'filterbyselection' is not available now". Is
there such an animal or am I just using it incorrectly? I
suspect the latter is the case. I appreciate any help
offered.

Thank you
 
A

Allen Browne

If you are trying to put this into the Click event of a command button, when
you click the button *it* has focus, and naturally enough you cannot filter
by the selection in a command button.

You could try:
Screen.PreviousControl.SetFocus
RunCommand acCmdFilterBySelection

That's like to be flakey, e.g. if there was no previous control.
Probably easier to use the toolbar button, where the focus issue does not
come into it.
 
G

Guest

Thank you very much, Mr Browne. Maybe that's what I'll
do - just use the toolbar. It seems like too much of a
hassle to code it.
 

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