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 / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

Disabling Shortcut menu Item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 02 May 2005 01:54 GMT
Hello,

I have customized my own ShortcutMenu in which it has Macros as the Items.  
All is working ok.

What I would lke to know is that somtimes I would like certain Items of this
Shortcut Menu to be disabled & other items to have them all enabled.

Can this be done with VBA code to control this ?  If so how ?

I saw from the Help menu
DoCmd.SetMenuItem 0, 1, , acMenuGray
which is what I would like to do but it says:
"Note   The SetMenuItem method works only with custom menu bars and global
menu bars created by using menu bar macros. "

Can this be used for Shortcut Menus & how ?  or other code like this for
Shortcut menus ?

Any help would be greatly appreciated.

Thank you,
Jeff
Albert D. Kallal - 02 May 2005 06:42 GMT
if IsInGroup(CurrentUser,"SuperUser" then

    CommandBars("menu bar").Controls("records").
               Controls("refresh").Visible = True

end if

if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then

    CommandBars("myCustomBar").Controls("AdminOptions").
                 Controls("DleeteInvoice").Visible = True

end if

Note that short cut menus are their own name also:

          commandbars("your shortcut name").
                    Contorls("contorlName").Visible = false

or

          commandbars("your shortcut name").
                    Contorls("contorlName").Enabled = false

additional notes:
   You can use "enabled" in place of visible.
   The above examples should be on one line...but I wrapped them into two
lines for ease of reading....

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal

 
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.