Access 2007 Toolbar Issue | Member | | Join Date: May 2008
Posts: 43
| | |
We have set up a function as listed below to display a custom toolbar used to
export data from the report. The function is called from the open event of
each report:
Function CBShowPrint()
Application.CommandBars("BranchPrint").Enabled = True
Application.CommandBars("BranchPrint").Visible = True
End Function
We recently converted from Access 2003 to Access 2007. (The custom toolbar was created in Access 2003. There are 3 issues with the conversion:
1) The user must now click on the menu item Add-Ins to display the toolbar
2) The Export to Excel no longer functions indicating an incorrect format.
3) The Export to Word has disappeared
My questions are as follows:
1) Can the Add-Ins click be bypassed programmatically, so the user sees
the custom toolbar as soon as the report opens.
2) It is my understanding that Access 2007 no longer allows the creation of
custom toolbars. Can the above function be modified to programmatically
display toolbar items which allow extracts to Excel and Word for the Access
2007 format
Thanks in advance
| | Expert | | Join Date: Oct 2008 Location: Cedar City, Utah, USA
Posts: 86
| | | re: Access 2007 Toolbar Issue
I was just looking at the options for making customizations to the 2007 Ribbon yesterday. The Ribbon uses XML as its source, so what you do in Access is create a table in your database called "USysRibbons" with ID, RibbonName and RibbonXML fields. Create the XML in the proper format and put it in the RibbonXML field, then load the custom ribbon you want using the RibbonName property in Startup or on any form or report.
This is the tutorial on it from msdn that I was looking at: http://msdn.microsoft.com/en-us/library/aa338202.aspx
There isn't a way to make an old 2003 toolbar appear anywhere other than "Add-Ins." If you're going to be using 2007 or newer, you should use the Ribbon.
The tutorial also explains integrating with other Office applications, which should answer your question about exporting to Word or Excel.
EDIT: P.S. This tutorial is part one of 3. The first part explains customizing the Ribbon, the second enumerates and describes the attributes and elements of the Ribbon, and the third is a FAQ. The three parts are grouped together in the list box on the left side of the msdn site.
| | Member | | Join Date: May 2008
Posts: 43
| | | re: Access 2007 Toolbar Issue
Thank you. I have already began going through the examples and have successfully created items on the ribbon. (It seems to have a lot more capability than before, however, it used to be simpler and easier with the 2003 toolbars! )
|  | Expert | | Join Date: Sep 2007
Posts: 268
| | | re: Access 2007 Toolbar Issue
Two must have tools when doing your ribbons: IDBE Ribbon Creator
A visual ribbon designer.. you can interface this directly with your database, or create ribbons from scratch and export the code to XML. I usually use this when using a new feature (drop down boxes, complex menus, etc), see how the code gets exported, and then implement that into my database. Office 2007 Custom UI Editor
A simple intellisense validator. Good for when you screw up your code and need to find out exactly what went wrong.
| | Expert | | Join Date: Oct 2008 Location: Cedar City, Utah, USA
Posts: 86
| | | re: Access 2007 Toolbar Issue
Hey, Megalog, you obviously have experience in this realm. MS has ended corporate support of Office 2003, prompting businesses to "upgrade" to 2007. Since I see this as becoming a common issue as more companies make this transition, why don't you do a How-To on customizing the ribbon, including links to helpful resources like the apps you reference, in the "Insights" area?
| | Member | | Join Date: May 2008
Posts: 43
| | | re: Access 2007 Toolbar Issue
tofer23, Megalog
Thanks for the great responses. I have checked the websites you have suggested and keyed in some of the examples to create the various customizations. Do either of you know if these customizations can be used to create something that looks like a toolbar and does with the Access 2007 customizable toolbar does. I set up the Access 2007 customizable toolbar exactly the way I would like it by bringing in the various functions to export data to various applications. I would like this toolbar to display whenever the user clicks on any of the reports I have developed within the application. The problem is that this toolbar is specific to my Access 2007 software and not the application I have developed, which gets deployed to various users. In addition, I could not toggle it off and on depending on when the user clicks a report. Do either of you know if the ribbon can be used to create something resembling this toolbar, which can perform the various data export functions, and then be activated whenever the user clicks on a report. In Access 2003, I set up a function to activate such a toolbar which was triggered from the open event of each report.
| | Expert | | Join Date: Oct 2008 Location: Cedar City, Utah, USA
Posts: 86
| | | re: Access 2007 Toolbar Issue Quote:
Originally Posted by topher23 ...what you do in Access is create a table in your database called "USysRibbons" with ID, RibbonName and RibbonXML fields. Create the XML in the proper format and put it in the RibbonXML field, then load the custom ribbon you want using the RibbonName property in Startup or on any form or report. This is all in the msdn tutorial.
| | Member | | Join Date: May 2008
Posts: 43
| | | re: Access 2007 Toolbar Issue
Looks like tha's it. I was hoping to imitate the Access 2003 toolbar in that when the user clicks a report, the toolbar appears. It looks like that the user will have to first click the menu item, and then the control items will appear. It should be okay. Thanks for the help.
| | Expert | | Join Date: Oct 2008 Location: Cedar City, Utah, USA
Posts: 86
| | | re: Access 2007 Toolbar Issue
Unfortunately, the Ribbon isn't quite what the old menus and toolbars were, but it is very useful. At the very least, you can turn off the ribbon tabs you don't want so only the custom one appears. That may solve some of your problems. Quote:
msdn tutorial:
The tabs displayed in the Fluent UI are additive. That is, unless you specifically hide the tabs or set the Start from Scratch attribute to True, the tabs displayed by a form or report's UI appear in addition to the existing tabs.
So, in your ribbon's XML, set - <ribbon StartFromScratch="True">
and it will be the only tab on your ribbon.
|  | Expert | | Join Date: Sep 2007
Posts: 268
| | | re: Access 2007 Toolbar Issue Quote:
Originally Posted by topher23 Hey, Megalog, you obviously have experience in this realm. MS has ended corporate support of Office 2003, prompting businesses to "upgrade" to 2007. Since I see this as becoming a common issue as more companies make this transition, why don't you do a How-To on customizing the ribbon, including links to helpful resources like the apps you reference, in the "Insights" area? I might do that someday, if I get the time. The thing is, I dont like referencing the MSDN tutorials since I think they're badly written. So I would probably have to write up quite a bit of material that actually flows correctly, unlike the tutorials which bounce all over the place and supplies bad code.
| | Member | | Join Date: May 2008
Posts: 43
| | | re: Access 2007 Toolbar Issue
topher23, I set StartFromScratch to True and have come as close to the Access 2003 toolbar as Access 2007 will allow. Thanks again. Megalog, I agree with topher23's idea for writing up some new documentation and would concur with your opinion on some of the existing MSDN documentation.
|  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,223 network members.
|