PDA

View Full Version : Ribbon toggleButtons Highlight and Un-Highlight



grinmom
01-27-2024, 10:29 AM
I’m on probably 12 hours of trying to get this to work. Fingers crossed no one asks me to post what i have tried because i have tried and typed over a million times.

I have a custom xml ribbon with four toggleButtons, when I click a toggleButton, it opens a form (in Access), I would like that button to stay highlighted. Then, when i click on another toggleButton, I want to highlight that one, and un-highlight all others. Is that possible?

I have tried all scenarios of OnAction and getPressed and trying to invalidate the ribbon and i tried invalidating the control, and returnedVal, etc. I guess I’m not doing it in the correct order because they either all stay highlighted or none at all.

I guess I’m not understanding the difference between OnAction (ie open the page i want) and getPressed (is that just capturing the state of the button on click)? I then come down to why would i even need getPressed? In theory, I want OnAction - turn the state of my current control to pressed = true, and all others False.

I just cannot for the life of me figure out how. Please help!

grinmom
01-27-2024, 11:20 AM
Not sure this will post, i just tried and i got "denied"?? but I tried to post a copy of the code from Paul Hossler, maybe it didnt like that?

I figured it out with Pauls code. I started from scratch to retrace my steps and realized i was passing another variable in the xml code and that was throwing the whole thing off. :banghead:

Aussiebear
01-27-2024, 11:59 AM
Glad you were able to work out an answer. Not sure what's going on with the forum lately. Another person was trying to post and they got denied initially as well.