473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Controlling a Toolbar from another Form

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

Forms!frmClipping!Toolbar1.Buttons(2).Clicked = True

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


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

Forms!frmClipping!Toolbar1.Buttons(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!frmClipping.Toolbar1_ButtonClick()

--
MGFoster:::mgf00 <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/AwUBRU0MSYechKqOuFEgEQKArACcC7QMg7eAkbsUEbtsISOl9C 7wufEAnAoI
5ypfxNqFkuE9M+sP2Vi0Mq2K
=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_ButtonClick 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.comwrote in message
news:0%*****************@newsread4.news.pas.earthl ink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.Toolbar) and it works as advertised. I handle the buttons
in
the Toolbar1_ButtonClick event.
I would like to be able to control the toolbar from another form.

Forms!frmClipping!Toolbar1.Buttons(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!frmClipping.Toolbar1_ButtonClick()

--
MGFoster:::mgf00 <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/AwUBRU0MSYechKqOuFEgEQKArACcC7QMg7eAkbsUEbtsISOl9C 7wufEAnAoI
5ypfxNqFkuE9M+sP2Vi0Mq2K
=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_ButtonClick event public, and it is
callable. But as I said, it wants a toolbar button passed. The code turns
out to be:

Call Form_frmClipping.Toolbar1_ButtonClick(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.comwrote in message
news:Y7t3h.2650$MO6.1029@trndny06...
Thanks MG, I see where you are going with this.
There are some remaining problems though. The Toolbar1_ButtonClick 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.comwrote in message
news:0%*****************@newsread4.news.pas.earthl ink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.Toolbar) and it works as advertised. I handle the
buttons
in
the Toolbar1_ButtonClick event.
I would like to be able to control the toolbar from another form.
>
Forms!frmClipping!Toolbar1.Buttons(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!frmClipping.Toolbar1_ButtonClick()

--
MGFoster:::mgf00 <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/AwUBRU0MSYechKqOuFEgEQKArACcC7QMg7eAkbsUEbtsISOl9C 7wufEAnAoI
5ypfxNqFkuE9M+sP2Vi0Mq2K
=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_frmClipping.Toolbar1.Buttons(x) ' where x is the button
index
Call Form_frmClipping.Toolbar1_ButtonClick(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.comwrote in message
news:0%*****************@newsread4.news.pas.earthl ink.net...
Gerhard wrote:
I have an MS Access app with multiple forms. One of the forms has a
Toolbar
(MsComctlLib.Toolbar) and it works as advertised. I handle the buttons
in
the Toolbar1_ButtonClick event.
I would like to be able to control the toolbar from another form.

Forms!frmClipping!Toolbar1.Buttons(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!frmClipping.Toolbar1_ButtonClick()

--
MGFoster:::mgf00 <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/AwUBRU0MSYechKqOuFEgEQKArACcC7QMg7eAkbsUEbtsISOl9C 7wufEAnAoI
5ypfxNqFkuE9M+sP2Vi0Mq2K
=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
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...
0
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...
5
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...
5
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...
6
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...
2
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...
4
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...
8
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.