Attaching a Macro to a custom menu

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

Guest

I have created a custom menu and want to attach a macro to it. After going
to tools, customize, I right-clicked on the menu item and chose properties.
There is a place to choose a macro in this box.

However, I need a macro to run the following code:

On Error Resume Next
DoCmd.SelectObject acReport, Screen.ActiveReport.Name
DoCmd.RunCommand acCmdPrint

I have tried to use RunCode in the macro action, but it is looking for a
function, which I am not using. Is there another way to achieve this? I am
explaining this the best way I know how. Any help would be greatly
appreciated!!
 
I've tried (with my limited knowledge), but I don't know enough about VBA to
make it into a function. I wasn't sure what arguments to put in for the
function. Can you help me?
 
Back
Top