Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / July 2007

Tip: Looking for answers? Try searching our database.

Attaching a Macro to a custom menu

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sarah0824 - 24 Jul 2007 19:20 GMT
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!!
Douglas J. Steele - 24 Jul 2007 22:03 GMT
Make that VBA code into a function, then call it.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>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
[quoted text clipped - 12 lines]
> explaining this the best way I know how.  Any help would be greatly
> appreciated!!
Sarah0824 - 25 Jul 2007 02:48 GMT
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?

> Make that VBA code into a function, then call it.
>
[quoted text clipped - 14 lines]
> > explaining this the best way I know how.  Any help would be greatly
> > appreciated!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.