473,657 Members | 2,680 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 CallbackGetPres sed(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 3265
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_MybuttionStat e = 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.com wrote in message
news:M7Ugi.6990 3$1i1.9286@pd7u rf3no...
> 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_MybuttionStat e = 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
6074
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 the bottom of every PHP page. The board should have just the basic features, like: - posting capability
3
3684
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example program #include <list>
8
6492
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
2059
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 unstructured (no nested sections). And is not really very simple. Before trying to setup a stripped-down document format by myself, I would like to know if there are simple XML document structure proposals ready to be used (I dislike to reinvent the...
11
2700
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
2099
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 of the string cannot increase either (no more than 14 chars) and must be numeric only.
7
2281
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 that page like http://machinename/dir1/hellp.aspx instead of running that page it starts downloding ...whats missing here ....why the aspx engine not running the page....
14
2974
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
3
17238
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 query.
0
8407
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1732
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.