Dynamically Update Ribbon problem.

R

rick123

I have been working on upgrading an XP db to ACC2007 in which I want to use
the RibbonUI. I have all the code and such completed, and it works fine
except......

I have 2 LabelControls that I need to change dynamically from time to time.
The Callbacks are working correct when the Ribbon firsts load (upon DB
start-up). When I want to change the label, I use the .Invalidate method to
do so, but the trouble is that the Ribbon actually will not update (screen
wise). Placing a breakpoint in the VB code in the callback sub, I can see
the code run, but the ribbon actaully does not reflect the changes. I have
to exit the DB and re-start to get the correct labels to show.

I have done a lot of research and bought just about every E-Book I can find
on the subject. Everything says that when the .Invalidate method is called,
the Ribbon will update on the screen, except it doesn't. Has anyone
experienced this behavior also? Any tips or suggestions would be greatly
appreciated to get me heading back in the right directon, I have spent too
much time on this as it is.

Thanks in advance.
 
M

Mark Andrews

Rick,

Are you setting a global variable and the callback uses the global variable
to change the label in the GetLabel callback?

You could send me the db and I'll take a look.

I haven't seen the ribbon do anything weird up to this point, but I would
like to learn if there are such issues.

Also checkout my first few articles on the Ribbon (you might be past these
basics, but they might help)
http://www.rptsoftware.com/help/microsoft_access_general/

Mark
RPT Software
http://www.rptsoftware.com
 
R

rick123

Yes, the Ribbon is loaded globally just as you described, exact same code. If
I place a breakpoint in the callback code for the Label, and then use the
..Invalidate method on the ribbon object, I can see the VBA code run, so I
know that everything is happening just like the book says. The only trouble
is, the actual screen is not showing the change in the label.
Further, when the ribbon loads, it uses the callback of getLabel to get the
value of the label. This is the code I can get to run using the .Invalidate
method. But it just mystifies me on why the ribbon won't repaint.
The labels indicate the current user and the current department they are
working in, so that is why I need the labels to update when the department or
user is changed.

I have checked to make sure I have all the patches and updates from
Microsoft, and I am just wondering is any else experiencing this action? Or,
is it just my dumb luck...
 
M

Mark Andrews

My last ribbon only had buttons in which the labels changed dynamically, and
it worked fine.
I had one label but it only changed on startup as you describe, I didn't try
to change it dynamically.

Perhaps try it with a button?

I just tried changing the code so a label updates dynamically and it worked
fine as well.
the code I used was:
strCustomerLabel = "blah"
gobjRibbon.InvalidateControl "MyLabel"

I would guess there is something else weird going on?

My offer to look it your code is still valid.
I will be kinda busy the next few days on a client project but will make
time.
Perhaps strip down your app to just the xml, the callback code and a simple
form
with a button to change the label.

Sorry I can't help more,
kinda hard without getting into the details,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top