473,379 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

MS Access 2013 - Custom Ribbon won't work

twinnyfo
3,653 Expert Mod 2GB
OK. So for about a million years, since MS Office has been using their ribbons, I've been able to create a Custom Ribbon that I use exclusively for my Reports:

Expand|Select|Wrap|Line Numbers
  1. <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  2.     <ribbon startFromScratch="true">
  3.         <tabs>
  4.             <tab id="dbCustomTab" label="Reports" visible="true">
  5.                 <group id="dbCustomGroup" label="Report Functions">
  6.                     <control idMso="PrintPreviewZoomMenu" label="Zoom" enabled="true"/>
  7.                     <control idMso="PrintPreviewClose" label="Close" enabled="true"/>
  8.                     <control idMso="PrintDialogAccess" label="Print" enabled="true"/>
  9.                     <control idMso="FileSaveAsPdfOrXps" label="PDF" enabled="true"/>
  10.                 </group>
  11.             </tab>
  12.         </tabs>
  13.     </ribbon>
  14. </customUI>
I turn off all the toolbars and menus and then, when someone generates a report, the Reports Ribbon appears, because it is assigned to the RibbonName Property of each of my reports.

This has worked flawlessly since the Dark Ages.

One of my co-workers recently was upgraded to MSO 2013. The Reports ribbon no longer showed up, and all of a sudden, the Print Preview Ribbon started showing up on his reports. But, he was unable to use any of the built in buttons for that ribbon.

Now, the rest of the office has been upgraded to MSO 2013 (including your friendly local Database Administrator), and now the custom Ribbon does not work for anyone.

Any ideas why this works this way (or more correctly, doesn't work)?

Any suggestions for the dreaded "workaround"? I think one workaround might be to turn the toolbars back on every time there is a report generated.

I also don't want to add "Print" and "Close" buttons to all of my reports, either.

Any advice or insight would be appreciated.

Grace and peace!
Apr 18 '16 #1
13 7593
Seth Schrock
2,965 Expert 2GB
My workaround has been to not use Access 2013. At work I have both Office 2010 and Office 2013 installed. I use Access 2010, but everything else I use 2013. I'm not sure if this is an option for you, but it does work. While I have never done much with custom ribbons, I really don't care for Access 2013 or 2016 due to some other issues.
Apr 18 '16 #2
twinnyfo
3,653 Expert Mod 2GB
Seth,

Unfortunately, that is not an option for us. We have managed systems. Plus, if others had 2013 and I did not, some of the "standard" functions like Date() would not even work with those systems. Crazy, huh?

Overall, I just hate the new MSO 2013, the interface, the appearance, the headaches it's causing. All around not happy!
Apr 18 '16 #3
NeoPa
32,556 Expert Mod 16PB
Hi Twinny.

This may be a red herring, but the only time I worked with ribbon customisation, which was in Excel and not in Access, I found that the underlying XML was stored under a different-named heading for 2007 and 2010. Admittedly, I was under the impression that everything after 2010 would stay in the same place, but I never went further.

I suspect you'll need to replicate your customisation work specifically for 2013.

It's just an idea. I can't say if it's right or not.

HTH -Ade.
Apr 18 '16 #4
twinnyfo
3,653 Expert Mod 2GB
Thanks, Ade,

So, the Sargasso becomes thicker....

No help with reduplicating the XML, but it was worth a try.

So here's a strange workaround, but not a solution:

When we open a report in the DB, we can use keyboard shortcuts, such as Ctrl-P to bring up the Print Menu and Esc, to just close the report.

But..... Here is the really strange thing, when we bring up the Print Menu that way, and then print to PDF, after the PDF is created.... Voilá! The Reports Ribbon magically appears!

From that point on, as long as the user stays in the DB, the reports ribbon works. I've been experimenting with ways to "force" the DB to think that it is exporting to PDF (OutputTo Method, etc.,) but no such luck.

I'm wondering what is "behind" this behavior? If I understood that, then I would at least have a direction to go for trouble-shooting. For now, I'm just blind-folded, in the dark, throwing darts backward at a dartboard that's behind a brick wall while I'm hanging upside down with my hands behind my back, using headless and finless darts--in a hurricane.... Or something like that.

Any outside-the-box ideas?

:-)
Apr 18 '16 #5
TheSmileyCoder
2,322 Expert Mod 2GB
Are you specifically turning off teh ribbon toolbar? Then I imagine that would do it for you, and cause weird behavior. If that is the case, I would say its more of a bug in 2010 that it worked at all.

Workarounds I can think of:
Create a (non-dialog) popup form that opens when the report opens, and closes when it closes again, with the functionality required.

Re-enable the ribbon, and have a blank default ribbon.

You *could* try to use the reports activate/deactivate event to turn on/off the ribbon toolbar, but I have no idea if that would be "flaky" in use.
Apr 20 '16 #6
zmbd
5,501 Expert Mod 4TB
TwinnyFo,
How are you calling your ribbon?

I have only the default library references set and no ribbon callback code at this point in the test database

I created the TwinnyRibbon using the table method.

I had no issues when using this as the default ribbon at start-up in the database
(File>Options>Current Database>Ribbon and Toolbar Options>Ribbon Name)

If I set the above option to none and attached TwinnyRibbon to a report, then only the <FILE> ribbon shows when the report opens.

If I set the above option to a test ribbon I've been working on, set that ribbon's <ribbon startFromScratch="true"> leave TwinnyRibbon attached to the report
>My ribbon opens fine with the database
>Report opens and my ribbon disappears and TwinnyRibbon replaces my ribbon.
>Closing the report, my ribbon returns.

If I set my test ribbon <ribbon startFromScratch="false">, have it start with the database and leave your ribbon attached to the report. When the report opens only the <FILE> option is visible.

If I set the library reference for Microsoft Office 15.0 Object Library:
> Leave my ribbon as the default startup for the database,
> leave <ribbon startFromScratch="false">
> leave TwinnyRibbon attached to the report.

When I close and reopen my database:
> my toolbar shows as a tab in the default ribbon.
> Opening the report, TwinnyRibbon replaces the default ribbon.
> Closing the report and the default ribbon returns.

IMHO, if you do not want to set the MSO15OL then create a default Ribbon, set the on <ribbon startFromScratch="true">, set this ribbon to start with the database options.

MSOffice2013(32Bit) on Win7Enterprise(64Bit)
-Z
Apr 28 '16 #7
twinnyfo
3,653 Expert Mod 2GB
Z,

Great insight, as usual, and thank you for testing several iterations. I have replicated your iterations with no success.

The only way I can always get the ribbon I want to show up for my reports is to have the reports Ribbon be the default ribbon for the DB. This is not really a problem, because the reports are the only part of the DB in which people can use the ribbon.... so I'm good with that.

But, again, and this is the extremely strange part: Every time I DO get the ribbon I want to show up, it is disabled. But, when I Ctrl-P and then print to PDF, the functionality "magically" is enabled. Then, no matter how long I stay in the db, the ribbon runs perfectly. This same behavior occurs both before and after creation of the .accde file.

I just can't figure out what is causing this behavior. Hence, Goofy scratching his head, yet again!
Apr 28 '16 #8
nnoam1
1
I tried your ribbon with my Access2013 and it works well! It seems that you open your reports in acViewReport view. Isn't it?
If that's the case - some of your ribbon controls are unavailable.
Instead, use acViewPreview - and the ribbon will function alright!
Can you write here your OpenReport code?
Apr 28 '16 #9
zmbd
5,501 Expert Mod 4TB
nnoam1:
The way I understand TwinnyFo, and the behavior I saw during my tests, is that the custom ribbon tab does not show up at all.

TwinnyFo:
+ Even with the MSO15OL reference set?
+ I'll have to try making an *.ACCDE file.
+ I suspect that TheSmileyCoder has HTNOTH here with a bug in implementation.

curious indeed!
Apr 29 '16 #10
twinnyfo
3,653 Expert Mod 2GB
nnoam1,

I am opening my reports in AcViewPreview mode. Always have.

===============

Z,

With or without MSO15OL--same results.

Very curious--per your PM, I'll send something your way. I Really, truly HOPE you encounter the same results!!!!
Apr 29 '16 #11
twinnyfo
3,653 Expert Mod 2GB
OK Friends, this must be the STUPIDEST solution I have ever found for working with MS Access VBA. But, you might get a few laughs out of this one.

Anyway, all my efforts have been focused on MS Office 2013 and the VBA solutions that might be found within, but my office mates and I observed some very strange behaviors with this ribbon. As mentioned earlier, when we hit Ctrl-P and printed to PDF, the ribbon magically appeared and functioned as expected. I was unable to achieve results by programmatically printing the report to PDF.....

However, we also noticed something even stranger. I was using the DB earlier today, but was not printing any of the reports. During the normal course of my work, I was distracted with some other projects (with the DB still open). I went back to the DB, opened a report and violin! The ribbon worked perfectly. Very strange.

Closed the DB, opened again, and the ribbon was kaput, as expected. Hmmmmm... I had to open an older file--in PDF format--for some other work. Ahh--I need to check something in the DB. Open a Report--Ribbon works fine!!!!

Hmmmmm.... Let me test this again.... Restart PC.... Open DB.... Ribbon no worky.... Open PDF.... Ribbon worky!!!

So, my "SOLUTION" is a work around, at best. I added the following code to the opening actions of the DB.

Expand|Select|Wrap|Line Numbers
  1.     FollowHyperlink "\\Server\Path\Folder\DUMMY.pdf"
  2.     SendKeys "^w", True
Dummy.pdf is just a blank page that I saved as a PDF. Now, when I open the DB, the ribbon works. Doesn't make any sense, because these two software applications are in no way related--not even made by the same company. But it works!





DUMBEST



THING



EVER!!!!!!!




Have a great weekend, y'all!
Apr 29 '16 #12
zmbd
5,501 Expert Mod 4TB
Shell Function
Shell the PDF and then no need for the sendkey
Not sure how to close the Shelled program

Windows API ShellExecute() function
I've played with this one too a bit trying to be able to close the shelled program; however, the APIs are a bit new to me and with the 64-Bit platform potential you have to allow for that:
64-Bit Visual Basic for Applications Overview

In both cases I was working on a way to automatically roll-out new versions of the frontend. :)

In the meantime I've not had a chance to look at the file you sent. Been a very long and busy day - dealing with family issues... :-(
Apr 29 '16 #13
zmbd
5,501 Expert Mod 4TB
I opened the file you sent on my home pc,
Windows 8.1-Personal(64bit)
Access 2013(32bit)
First thing that happened is that there were multiple warnings about not having the Adobe Acrobat references set.
1) I don't have acrobat (or any adobe product) installed on this pc
2)Access 2013 has it's own PDF engine

I opened the library references (once I got past all the errors) and removed the selections for the Acrobat libraries (two of them marked as missing :) )

Your toolbar worked just fine afterward.

I suspect that the Adobe Acrobat object libraries may be interfering with the Access2013 native PDF support. This may explain the weird behavior you are seeing when you load the fake PDF.

Easy enough to check - deselect those references on your test PC.

This doesn't explain the weird behavior I saw at work; however, we have Acrobat installed on our PC's there.... BUT, I also do not have those libraries referenced in any of my databases so I don't think I've found a root cause.

You might want to try decompiling and then recompiling the database...
TheSmileyCoder > how to decompile an access application or how to do a full fresh compile.
Personally, I would decompile, uncheck the Acrobat libraries, and then recompile.

If that doesn't work it may be worth unchecking those references and then un-installing Acrobat and then RE-installing Acrobat just in case the libraries are damaged. At work, it seems that we're always behind the curve on updates and they have group policy that locks down which programs can run and which cannot - very aggravating. I'm wondering if the version being used has the issue.



-z
Apr 30 '16 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kal | last post by:
I have registered my custom control in web.config as follows: <add tagPrefix="PhoenixControls" namespace="PhoenixControls" assembly="PhoenixControls"/> I have added a file called...
1
by: btsnyder | last post by:
I have a customized Ribbon for Access 2007 with various buttons that open different forms. When opening certain forms, none of which have their own custom ribbon assigned, the selected tab is reset...
5
by: Sandra Walsh | last post by:
Hello - I am working in Access 2010. I am trying to show a custom ribbon when a report is opened in Print Preview mode. I have created a custom ribbon called Print and Send. This ribbon...
4
by: nomeepk | last post by:
hi, i am using access 2013, Is there a way i can make this Access Database online, so i can access and use it from anywhere in a Browser? Regards.
5
by: jimatqsi | last post by:
I'm looking for information about compatibility between Access 2013 and Access 2003. I've been approached by a firm that wants to begin upgrading their systems. I want to know if it is reasonable...
0
by: LeoVBNET | last post by:
Hi Because VS 2013 dropped SQL COMPACT databases, I need to convert Access 2013 databases into SQL COMPACT in order to be able to use Linq to SQL in VB 2013. Anybody can help me? Thanks
6
by: GKJR | last post by:
I have been using Access 2013 (in Office 365) with Windows 8.1 for about a month and a half now. I was a little reluctant to switch from 2010 on Windows 7, but I figured I should try stay ahead of...
10
by: CD Tom | last post by:
I've created a custom ribbon (first time) it works fine but I can't figure out what to do when I have a print preview on the screen. It seems like when you have a custom menu the print menu doesn't...
6
by: msilva100 | last post by:
Hello, I need to have remote access to a MS Access 2013 Database running on a Windows 7 Server. Can someone kindly recommend a remote access tool? Thank you.
1
by: msilva100 | last post by:
Is it possible to split a Runtime MS Access 2013 database? I am on a Windows 7 server. I have one license of MS Access 2013. But I would like distribute this application to 5 client workstations. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.