Many Thanks, Albert. I hope you see this post, as I did finally figure out
that I had to use global variables to store / set the state.
However...A couple big problems:
1) If an error occurs, the global ribbon variable is reset, so any of your
code to set the states no longer work. The only option is to close the
database, and re-open. And I thought maybe I could use the new system
variables of Acces 07, but they won't allow you to set them to objects. I
know I have to get the code bug free, but while I'm doing that, is sure is a
pain to exit the db, and go back in just from a simple error.
2) If 2 ribbons both call the same OnLoad, does this cause a problem? The
onload is simply setting something like: set myribbon = ribbon. But if you
need to access that to do things like getLabel, or onGetPressed, it seems to
cause a problem if 2 separate form ribbons are using the same proc in the
OnLoad.. Hope this makes sense, but I was wondering what the proper way. I'm
sure hoping that each ribbon doesn't need their own global ribbon variable
and separate OnLoad procs... Yikes, that wouldn't be fun.
Thanks again,
"Albert D. Kallal" <Pl*******************@msn.comwrote in message
news:M7Ugi.69903$1i1.9286@pd7urf3no...
> pressed = True
Where is the above value coming from?
When you use call backs, YOUR CODE must set the state of the button.
So, you need to declare a variable to hold the state
m_MybuttionState = true.
>I simply cannot find a way to reference this ribbon bar to get the
pressed in state.
You don't reference the bar, you reference YOUR CODE that sets the
state......
The callback code LOOKS TO YOUR code to GET the state. The ribbon no
longer holds the state...YOUR CODE holds the state.
So, you look at YOUR code to get the state...not the ribbon. The ribbon
asks your code what the state of the button is to be...not the other way
around.
It is mind set of change that you have to get used to....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com