Filter by Selection macro not working

S

Sammy

Hi, I created a macro that uses "Run Command" and then I chose
"FilterbySelection" from the list of available commands. I used the Wizard
to assign this macro to a command button on my form. When I try to run it I
get the following error: ACTION FAILED. then another box that says COMMAND
NOT AVAILABLE NOW. Even though I can use the regular FilterbySelection
button from the toolbar just fine. Any ideas why this doesn't work? Thank
you.


This is the code behind the button:

Private Sub Command71_Click()
On Error GoTo Err_Command71_Click

Dim stDocName As String

stDocName = "mcrFilterbySel"
DoCmd.RunMacro stDocName

Exit_Command71_Click:
Exit Sub

Err_Command71_Click:
MsgBox Err.Description
Resume Exit_Command71_Click

End Sub
 

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