Ribbons driving me crazy

JamworkS

Registered User.
Local time
Today, 03:20
Joined
Sep 1, 2011
Messages
49
Hiya all,

We've got an application that is based on user permissions to show/hide command bars, so that only X people can access Y menus, and so on, and the admins will access everything.

Up to now, has worked really fine, but the move from 2003 to 2010 has changed from horizontal menus as any windows app to a small tab called add-ins (complementos in Spanish) within the ribbon.

I've created a whole new routine to create an xml ribbon and that's been a success. I can create dynamically XML code for anyone based on different permisions.

So what's my problem? My problem is the following:

  1. I open my accdb, log in and shows my menu.
  2. Quit the db, and log in using a different username/password and still shows my menus, whilst it should show the user's.
  3. I open again and log in with that same different username, and now it shows the user's menu.
  4. I quite, open and log in with my admin passwors, and shows me again the last users menu. If I quite and open, do login, then It will show mine.

So to sum up, I don't know what I'm doing wrong, but I've created an autoexec macro to call a function which creates the xml for the ribbon, and then load the Ribbon with a Function that I found in www.accessribbons.de. So it seems that when I change a user, i have to close two times and open two times the database to show that user's Ribbon. What can I do?

I've tried to look for a refresh option in the ribbon but haven't find it.

Any ideas?

Cheers.
 
Everytime I run this: gobjRibbon.Invalidate it gives me an error, it says that it's not within a Width procedure.
That's not the exact error message. What's the exact error message?
 
Well, first error is this one:

(Part of the message is in Spanish, but the important part is in english, so you'll be able to understand it):

attachment.php


Any clue as to why that's happening to me and not to you all?
 

Attachments

  • error-onload.png
    error-onload.png
    9.2 KB · Views: 283
It simply says you haven't defined the IsLoad callback in your xml.
 
No, is not that ... I put it in the wrong place, I'm so tired I can't see things so obvious like that. I placed it in the ribbon tag, rather than in the customui tag.

Sorry for such a newbie mistake.

I'll post the next error, in a couple of mins.
 
Well, to start, this is my XML. Pretty simple, as I just want to run some tests with it, and as soon as it works, the whole big proper XML will be implemented:

Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="CallbackOnLoad">
   <ribbon startFromScratch="false">
   <tabs>
      <tab id="MenuGes" label="Menú GES">
         <group id="Grupo_GES_opcion_1" label="Menú General GES">

            <separator id="SEP_C"/>
 
                  <menu id="TS7" label="Usuario 1">
                     <button id="TS71" label="Control producto GAS en sistema SND" onAction="IA_CGS"/>
                     <button id="TS7C" label="Control datos en tablas de Ventas" onAction="IA_VVT"/>
                  </menu>
      

      


         </group>
      </tab>
   </tabs>
   </ribbon>
</customUI>

It works fine, as it is.
 
And here is the error it throws when I execute de Invalidate statement:

attachment.php


It just says the I'm launching something without a With Block not established.
 

Attachments

  • error-with.png
    error-with.png
    10.1 KB · Views: 273
Where did you declare your gobjRibbon?

And when you click Depurar (which I think means Debug - you see I speak Spanish too ;) ), what line does it highlight?
 

Attachments

  • error-declararvariable.png
    error-declararvariable.png
    6.2 KB · Views: 267
  • error-depurar.png
    error-depurar.png
    2 KB · Views: 265
Have you done a Compact & Repair of your db after making those changes? Sometimes with ribbons you need to perform that operation.
 
Upload your db and I'll have a look when I have some time.

Also tell me the steps to reproduce the problem.
 
What I want to do is change the whole ribbon with a different XML as soon as certain conditions apply, and they're always different. I have ready the function that recreates the new xml, and works perfectly but It happens that I can't seem to update the ribbon.

Do I have to enable anything in Access Options?.
 
Ok, ok, don't bite me!! :D

I'll see if I can post an accdb for you to see.
 
Well, here you are. This is just a simple accdb where I want to for example change the ribbon in real time, for example, make a button disappear or the whole tab, etc etc ... with a button from a form (the form I haven't created it yet).

I'm just trying it by running the function straight away.
 

Attachments

Users who are viewing this thread

Back
Top Bottom