473,722 Members | 2,242 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controlling a Toolbar from another Form

I have an MS Access app with multiple forms. One of the forms has a Toolbar
(MsComctlLib.To olbar) and it works as advertised. I handle the buttons in
the Toolbar1_Button Click event.
I would like to be able to control the toolbar from another form.

Forms!frmClippi ng!Toolbar1.But tons(2).Clicked = True

does not work. Does anybody have any ideas how to do this?
Gerhard


Nov 4 '06 #1
4 3656
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a Toolbar
(MsComctlLib.To olbar) and it works as advertised. I handle the buttons in
the Toolbar1_Button Click event.
I would like to be able to control the toolbar from another form.

Forms!frmClippi ng!Toolbar1.But tons(2).Clicked = True

does not work. Does anybody have any ideas how to do this?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming that you want to run the toolbar's Click event. Instead of
trying to manipulate the command button on the toolbar make the event
procedure Public and call the event procedure from the other form:

Call Forms!frmClippi ng.Toolbar1_But tonClick()

--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRU0MSYechKq OuFEgEQKArACcC7 QMg7eAkbsUEbtsI SOl9C7wufEAnAoI
5ypfxNqFkuE9M+s P2Vi0Mq2K
=VBer
-----END PGP SIGNATURE-----
Nov 4 '06 #2
Thanks MG, I see where you are going with this.
There are some remaining problems though. The Toolbar1_Button Click event
takes a button as object being passed. I am working on creating that, but I
am having problems.
Once instantiated the key or index property would have to be set on that
button object to indicate which button has been pressed or is being
simulated as being pressed.
Let me see how far I can get with this, the documentation is so so,
Gerhard

"MGFoster" <me@privacy.com wrote in message
news:0%******** *********@newsr ead4.news.pas.e arthlink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.To olbar) and it works as advertised. I handle the buttons
in
the Toolbar1_Button Click event.
I would like to be able to control the toolbar from another form.

Forms!frmClippi ng!Toolbar1.But tons(2).Clicked = True

does not work. Does anybody have any ideas how to do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming that you want to run the toolbar's Click event. Instead of
trying to manipulate the command button on the toolbar make the event
procedure Public and call the event procedure from the other form:

Call Forms!frmClippi ng.Toolbar1_But tonClick()

--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRU0MSYechKq OuFEgEQKArACcC7 QMg7eAkbsUEbtsI SOl9C7wufEAnAoI
5ypfxNqFkuE9M+s P2Vi0Mq2K
=VBer
-----END PGP SIGNATURE-----

Nov 5 '06 #3
Yeah, I am bumping up against limitations, both in COM and in Access, or a
combination of both.

I was able to make the Toolbar1_Button Click event public, and it is
callable. But as I said, it wants a toolbar button passed. The code turns
out to be:

Call Form_frmClippin g.Toolbar1_Butt onClick(btn)

The problem is the form that the call is being made from doesn't know that
there is a toolbar in the project. I can't create a toolbar button object on
the form that doesn't have a toolbar, I'm trying,
I guess that the toolbar is Private to the form that it sits on. And I
don't know how to make it public.

One solution would be to put a hidden toolbar on the calling form, just so
that I could create a button object, but that just seems so stupid.

If you have any other ideas, or if there is something I am obviously doing
wrong, please tell me. Right now, Gerhard

"Gerhard" <ge************ ****@inch.comwr ote in message
news:Y7t3h.2650 $MO6.1029@trndn y06...
Thanks MG, I see where you are going with this.
There are some remaining problems though. The Toolbar1_Button Click event
takes a button as object being passed. I am working on creating that, but
I
am having problems.
Once instantiated the key or index property would have to be set on that
button object to indicate which button has been pressed or is being
simulated as being pressed.
Let me see how far I can get with this, the documentation is so so,
Gerhard

"MGFoster" <me@privacy.com wrote in message
news:0%******** *********@newsr ead4.news.pas.e arthlink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.To olbar) and it works as advertised. I handle the
buttons
in
the Toolbar1_Button Click event.
I would like to be able to control the toolbar from another form.
>
Forms!frmClippi ng!Toolbar1.But tons(2).Clicked = True
>
does not work. Does anybody have any ideas how to do this?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming that you want to run the toolbar's Click event. Instead of
trying to manipulate the command button on the toolbar make the event
procedure Public and call the event procedure from the other form:

Call Forms!frmClippi ng.Toolbar1_But tonClick()

--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRU0MSYechKq OuFEgEQKArACcC7 QMg7eAkbsUEbtsI SOl9C7wufEAnAoI
5ypfxNqFkuE9M+s P2Vi0Mq2K
=VBer
-----END PGP SIGNATURE-----


Nov 7 '06 #4
MG,
Ok, as usual it was a stupid thing, and sometimes it's a disadvantage to
know other languages, and to think along different lines. The actual code
turned out to be:

Dim btn as Object
Set btn = Form_frmClippin g.Toolbar1.Butt ons(x) ' where x is the button
index
Call Form_frmClippin g.Toolbar1_Butt onClick(btn)

Thanks for your help, and the fact that the other two lines took so long to
produce is due to the fact that I am out of practice with Access, and the
peculiar circumstance that there is no clear reference to mscomtl.ocx in
Access.
Or at least I don't have one, and don't know how to produce it. (I posted
another message about that today) Same in VB by the way, I checked,
Gerhard

"MGFoster" <me@privacy.com wrote in message
news:0%******** *********@newsr ead4.news.pas.e arthlink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.To olbar) and it works as advertised. I handle the buttons
in
the Toolbar1_Button Click event.
I would like to be able to control the toolbar from another form.

Forms!frmClippi ng!Toolbar1.But tons(2).Clicked = True

does not work. Does anybody have any ideas how to do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming that you want to run the toolbar's Click event. Instead of
trying to manipulate the command button on the toolbar make the event
procedure Public and call the event procedure from the other form:

Call Forms!frmClippi ng.Toolbar1_But tonClick()

--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRU0MSYechKq OuFEgEQKArACcC7 QMg7eAkbsUEbtsI SOl9C7wufEAnAoI
5ypfxNqFkuE9M+s P2Vi0Mq2K
=VBer
-----END PGP SIGNATURE-----

Nov 7 '06 #5

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

Similar topics

5
1449
by: Mainard | last post by:
Hi, all First off I know alittle about javascript, but i have never worked with controlling froms with it be for i wonder can some help me? for example:I have this <textarea name"write1">Write Your Message:</textarea> on a form called myform2, and i have another form and textarea on another page. how am i to send the text from one from to the other form?
0
1284
by: AliR | last post by:
Hi everyone, I am writing an MDI application, and I just learned how to merge my child form's menu with the parent, so I can handle the menu notifications with in the child form. Now I want to add a toolbar to my application, and I want to process the notification messages from the toolbar within my active child form. Is there a way to merge my child form's toolbar with the main form's toolbar? Thanks
5
3237
by: anthony.duerr | last post by:
I have encountered a problem (most certainly a .NET bug), that, for the life of me, I cannot figure out how to work around. Using Visual Studio 2003, with enabled XP Visual Styles. There are two possible scenarios here, the first one works properly, while the 2nd one doesn't. Scenario 1 ----------
5
1315
by: Tom Dacon | last post by:
I can't find any hits in groups search on this, so I'll try a fresh post: Vs.Net 2003 has recently started hanging when I try to pin the toolbar. The framework 1.1 service pack 1 has been installed, but I don't know if this started happening after I installed it. I've certainly only recently noticed the problem, and I believe (but can't be certain) that it's since the service pack was put on. The only way out of it seems to be killing the...
6
3128
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for ToolbarButtons... Does anyone know how this could be done? Looking forward to hear from you,
2
1365
by: Ahmed | last post by:
Hello everyone, I am creating a toolbar for an application. The buttons contains images and text. I set the wrappable property for the toolbar to false so the toolbar does not add another line when resize. In this case, when I resize the form the buttons on the toolbar get cut off. Is there a built in property to add ">>" at the end of toolbar to show the rest of the buttons? or
4
2771
by: LCAdeveloper | last post by:
Help! Another newbie question I'm afraid. I have a toolbar on an MDI form, which I can control OK to produce a child form. When the child form is active, the appropriate MDI parent form toolbar button properties are set as follows: .pushed=true and .enabled=false. My problem is how do I set the reverse conditions when I close this child form? I have tried putting (in the Exit button click event) Toolbar1.Buttons(6).Pushed=False...
8
2179
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
0
949
by: DonnaDarko | last post by:
Hi again, I have a question regarding how to control one form's values from another form. I have figured out that the best spot for this control comes from the OKButton on a form called "receptor". Based on the value of one of the option buttons chosen in this form, i want to set the value of a set of textboxes to zero in another form called "frmrisksettings". So far, all my ideas for controlling this have failed. any ideas? Below is the...
0
8860
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
9381
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9234
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
9151
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
4501
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...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2146
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.