473,503 Members | 11,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Acc2007 - getPressed, should be so simple!

ARC
Ok, this has to be the simplest of all things, but I've searched microsoft's
site, and the entire net!

If you put a toggle button in a ribbon, it is simple enough to get the state
using a callback function: getPressed...

Here's the wrinkle. I have a clear filter button on a form, and I want to
check the state of the toggle button (pushed in or not) from the form, NOT
the toolbar. This should be so simple, but using code like the example below
simply does not work:
Sub CallbackGetPressed(control As IRibbonControl, _
ByRef pressed)

' Callback getPressed

pressed = True

End Sub

Problem is, if you are calling this from a form, you don't seem to have
access to the control and other arguments in the above proc. I simply cannot
find a way to reference this ribbon bar to get the pressed in state. Keep in
mind, I need to find out FROM a button on a form, not from any ribbon xml's
or callbacks.

Help please!~

--
Andy
Jun 27 '07 #1
2 3260
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
Jun 28 '07 #2
ARC
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

Jul 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6065
by: delisonews | last post by:
I'm looking for a simple, filesystem-based message board. (No MySQL!) Something that I could include easily in my code: include '../inc/messageboard.php'; .... so that the board shows up at...
3
3659
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
8
6479
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
6
2049
by: Manuel Collado | last post by:
I would like to write simple, yet well structured documents with a really simple XML DTD (or schema). Either Docbook or SDocbook are overkill for this simple case. XHTML is simpler, but...
11
2676
by: JKop | last post by:
Take the following simple function: unsigned long Plus5Percent(unsigned long input) { return ( input + input / 20 ); } Do yous ever consider the possibly more efficent:
4
2084
by: Steven Blair | last post by:
I have the following number: 64521234567890 and need to apply some sort of simple encryption. Does c# have any classes for doing this. I cant use 3DES or anything as complex as. The size...
7
2265
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
14
2960
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
3
17217
by: Simon van Beek | last post by:
Dear reader, What can be wrong in my ComboBox, the property "Auto Expand" is set to Yes, but by typing in the ComboBox it doesn't expand. Is this because the source of the ComboBox is a...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.