A family of Microsoft relational database management systems designed for ease of use.
As a general rule one should attempt to figure out how to use one main ribbon for a given user. For forms then one can well easy “set” the ribbon in the forms on-load event. However, if you designed the ribbon correct, then you should only need one - and just hide or show a few of the options you want for "managers" or say "sales reps".
However for the application wide ribbon setting, quite sure this setting does not change until a re-start.
However a really “simple” and cool way around this issue is to set the application wide ribbon, but MAKE SURE the ribbon does not in fact exist. You then in your application start-up code using the LoadcustomerUI.
Remember the setting in a form or even the global ribbon is based on the “name” you give that ribbon WHEN you load it. For automatic loads from USYSRibbons, then the column “ribbon Name” is simply used.
However as noted you CAN specify ANY ribbon name when you use LoadCustomUI - and this includes any XML you have for existing ribbons in the USYSRibbons table!
So you might have a global ribbon setting of “MyMain”, but make sure NO such ribbon actually exists. Then in your start-up code you can grab any ribbon from the USYSRibbons table and execute a loadCustomUI on that ribbon.
Eg:
Dim strRib as string
‘Based on some user start-up setting, we want a managers ribbon, or a sales ribbon
If Manager = True then
strRib = dlookup("RibbonXml","USysRibbons","RibboName = 'Manager')
else
strRib = dlookup("RibbonXml","USysRibbons","RibboName = 'Sales')
End if
loadcustomui "MyMain",strRib
Note CAREFULLY how in above when you execute LoadCusteormUI you STATE the name you want to use – in this case “MyMain”. So this “MyMain” also happens to be the global ribbon setting you set for Access on startup. But note how that ribbon does not exist until you execute LoadCustomUI.
So the “name” you use when loading the ribbon can be the global setting in Access. Note that you can ONLY load into a given name ONE time for the duration of that application setting - so this will work to change the ribbon that displays - but you have to exit the application to switch that ribbon display again using this approach.
Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada