DataBase - Display custom Ribbon/Toolbar in Query Design
Asked By CP
12-Jan-10 04:18 PM

We have an Access 2003 application that we are converting to Access
2007. I have (finally) figured out how to create customized ribbons
to replace the customized menus in the older version. And I have
figured out how to
associate specific ribbons with specific forms. Now I have to figure
out a way to load another customized ribbon during Query & Report
Design which do not appear to have actual forms.
The code that loads the Query Design form and a custom Toolbar in the
Access 2003 version
is:
DoCmd.OpenQuery strQueryFullName, acViewDesign, acEdit
DoCmd.RunCommand acCmdDesignView
DoCmd.ShowToolbar "CLS Query Design", acToolbarYes
I have tried replacing the name of the old Toolbar with one of my new
ones but nothing shows. I also tried replacing it with "Ribbon" but
still nothing shows.
I have read through a lot of information about using the LoadCustomUI
command to make the list of all my customized ribbons available. BUT
I cannot find anything about how to actually access the Recordset that
is created. I think I can do Application.LoadCustomUI (customUIName,
customUIXML) for the particular ribbon but what goes in the
customUIXML parameter (I am guessing that the customUIName is the name
of my Ribbon or is the customUIName = the name of the table that
contains all the ribbons and the customUIXML is the name of the
particular ribbon)?
I am going around and around in circles so I hope someone can help me
get out.
Thanks in advance. Carol.
Application.LoadCustomUI
(1)
DoCmd.ShowToolbar
(1)
DoCmd.RunCommand
(1)
DoCmd.OpenQuery
(1)
Access 2003
(1)
Access 2007
(1)
PleaseNOOSpamKallal
(1)
CustomUIXML
(1)
Albert D. Kallal replied to CP

I would question the wisdom of allowing uses to modify sql.
What happens if someone types in:
drop table customers
and hits ctrl-> (ctrl key and the ">" key to run this?)
There should be VERY little reason for users to see the sql in
design mode.
For reports, the suggestion is best to supply an form with an
this concept is outlined here:
http://www.members.shaw.ca/AlbertKallal/ridesrpt/ridesrpt.html
In 20 years of writing software for customers, I never
had to allow customers every to see or type in dangerous sql.
Anyway, for forms + reports, you can specify the ribbon name in
the "other" tab.
For the application ribbon, you can simply go:
RibbonName = "Name of Ribbon Goes here"
The table of custom ribbons you build NEVER needs to be loaded as some
type of reocord set (so, your question seems like a wild goose chase).
No, you only need the above if you NOT going to use the USYSRibbon table and
want to load xml in code, or load xml from an external file. As long as your
USysRibbon table is created correctly, then you can use the above code, or
for forms + reports simply use the Ribbon Name setting in the property sheet
for the form or report.
You can also re-purpose the built in query design ribbon also. However, the
above code would be a drop in replacement for your code that displayed a
particular custom menu bar.
So, the above should work for you.
Keep in mind that allowing users to actually modify and change the design of
sql queries means they can create bad things like delete quires etc. I would
use great caution in allowing users to see the query builder. Parameters
etc. for reports can better be handled by just building an form that prompts
the users for the necessary parameters as the above link + screen shot
shows.
Anway, you can display any ribbon with the VBA code of:
eg:
RibbonName = "Name of Ribbon from USYSRibbons Goes here"
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
CP replied to Albert D. Kallal
Thanks, Albert.
I am pretty sure that my next question is one that I should know the
answer to but...
When I use the RibbonName =3D "Name of Ribbon from USysRibbons..." code,
I get "Variable RibbonName not found". When I put RibbonName as a
CommandBar or as an Object, I get error #91 (the dreaded "Object
variable or With Block Variable not set"). How should it be declared?
Re: giving users access to SQL, I will just say that this is a legacy
system that uses ODBC connections to Sybase tables and the users are
blocked from doing anything destructive to the database in any number
of different ways.
Thanks again for your help. Carol.
---------------------
esrpt/ridesrpt.html
and
our
r
eet
he
of
uld
pts
Albert D. Kallal replied to CP

Thanks, Albert.
I am pretty sure that my next question is one that I should know the
answer to but...
When I use the RibbonName = "Name of Ribbon from USysRibbons..." code,
I get "Variable RibbonName not found". When I put RibbonName as a
CommandBar or as an Object, I get error #91 (the dreaded "Object
variable or With Block Variable not set"). How should it be declared?
Let me try this....
Ok, Yes, you are right. The RibbonName ONLY works if you have a form open
(ribbonname is an property of an form..and you can use this to
switch/change the ribbon that is displayed but only with a form)
However, in your case, the "whole" problem (and I now realize your
original problem) is you DON'T have a form open here, but just the
query builder in design mode...
Ok, that means we have to simply allow the built in ribbon to display
(and you hint you do not want that).
You have to re-purpose the built in ribbon in this case. That means you have
to decide what features/options you want from the original design ribbon to
display. Another way to handle this
would be to use "start from scratch = true" to hide built in, and then
enable some query design groups you create in this replacement ribbon.
I never re-purposed built in ribbons. How to do this is outlined here:
http://www.accessribbon.de/en/index.php?Access_-_Ribbons:Ribbon_XML___Controls:Manipulate_existing_Access_Ribbons
Because I not done the above, then I would suggest you simply build your own
ribbon, and specify this ribbon as the Application wide ribbon. (and, then
simply use visible settings (call backs) to hide parts of this main ribbon
and turn on (display) the parts you need for the sql design mode. I
suggesting this as an somewhat easer path then trying to re-purpose all of
the query design ribbon (I think it less work).
it not clear, but I would assume you now have a system wide "default" ribbon
for your application? (this ribbon is where I would add in the ribbon design
parts you need/want into a custom ribbon group..and the you can hide/show
this group for query desing mode).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

DataBase Roger Jennings on Access / Sharepoint http: / / www.quepublishing.com / articles / article.aspx?p = 1606238 I was very dismayed reading is it makes it pretty clear that in-house hosting of your Sharepoint server with Access Services to support browser-based Access apps is something only large companies will be able to afford, because the pricing and licensing for the Enterprise version is very, very steep. The alternative is hosted Sharepoint / Access Services, and the costs do not seem terribly high. It seems to me that the pricing is upside-down. Big enterprises do not want to deploy Access apps in the browser - - they will build their own .NET apps, browser-based or not 2010, it could vastly increase those costs for organizations with legacy hardware). The features of Access 2010 used in conjunction with Sharepoint 2010 seem to me to be most compelling for and small businesses. I do not know if I could sell clients on hosted Sharepoint / Access. I have been able to sell clients on hosted Exchange, and it is been very said. All I would add is that most corporate IT departments will not deploy anything Access-based no matter what MS does to it. There is no question the pricing is
DataBase Access 2010 for software development Hi, What do I need to use Access 2010 (or perhaps 2007) to port our 2003 application and create an executable (MDE in Access 2003)? Are there any issues with 2010? -paulw You can use Access 2010 to develop your MDB until it is ready to release, but you will then need to use Access 2003 to create the MDE. - - Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users
DataBase Access 2010 with Sharepoint 2010 I found this article http: / / sharepointproconnections.com / Articles / tabid / 149 / nodeid to me was these two points: client." Hopefully this means you can test out the Access 2010 in a browser capabilities. 2.0 AA compliance. Level 1 browsers, which support 100 now we build applications to the office standard (that might use outlook, excel, and MS access on the desktop), in the future we build applications that does all the similar functions figure out what is not going to work as well in the browser as in Access itself? Surely you are not claiming that 100% of an Access app is going to convert to the browser-based Sharepoint version and have exactly the electricity is knocking on our door step and it here to stay. . . - - Albert D. Kallal (Access MVP) Edmonton, Alberta Canada pleaseNOOSpamKallal@msn.com Well, actually, yes I kind of am making have to choose a "web database" option for this to happen. When you do this access will restrict your feature set to web only features - - in fact this option even automatically no reason to have the server bits running during the development process. I had the access 2010 technical preview for almost a month before we actually got some server space to
NEW RECORDS TO FE TEMP TABLES On Error Resume Next 'Formerly: DoCmd.RunMacro "UpdateDatabase.Step1_HomeComp" DoCmd.OpenQuery "QEmpty_TempDischargeSummaries", acNormal, acEdit DoCmd.OpenQuery "QEmpty_TempAssessment1", acNormal, acEdit DoCmd.OpenQuery "QEmpty_TempAssessment2", acNormal, acEdit DoCmd.OpenQuery "QEmpty_TempBMPNew", acNormal, acEdit DoCmd.OpenQuery "QEmpty_TempBMP_TBs", acNormal, acEdit DoCmd.OpenQuery "QEmpty_TempTherapyPlans", acNormal, acEdit DoCmd.OpenQuery