A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Reusing Command Buttons



 
 
Thread Tools Display Modes
  #1  
Old February 3rd, 2005, 04:37 AM
roccogrand
external usenet poster
 
Posts: n/a
Default Reusing Command Buttons

I would like to create an application that looks like a website with the same
command buttons in the same positions on each main form. What are the
strategies for doing this without copying the same On_Click events into every
form?

There are ten buttons that I want on every form. To the right of these
standard buttons are context sensitive buttons. The standard buttons open
forms that I am calling my portals (10 of them). Each portal has anywhere
from 5 to 25 command buttons that open forms and reports.

Thanks.
  #2  
Old February 3rd, 2005, 04:48 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

The key issue here is keeping maintenance to minimum. My preferred approach
would be to put the code for the buttons into functions a standard module.
Then set their On Click property to the function name. You can then copy the
buttons onto other forms, and this property is copied. If your code needs to
be abe to distinguish which form called the code, you could set the On Click
to:
=MyFunc([Form])
and set up the function as:
Public Function MyFunc(frm As Form)
and then you can use "frm" in the procedure whereever you would have used
"Me".

Another approach would be to put the buttons onto a subform, and place the
subform on each form. This is less efficient on resources, and IMHO no
simpler to maintain.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"roccogrand" wrote in message
...
I would like to create an application that looks like a website with the
same
command buttons in the same positions on each main form. What are the
strategies for doing this without copying the same On_Click events into
every
form?

There are ten buttons that I want on every form. To the right of these
standard buttons are context sensitive buttons. The standard buttons open
forms that I am calling my portals (10 of them). Each portal has anywhere
from 5 to 25 command buttons that open forms and reports.

Thanks.



  #3  
Old February 3rd, 2005, 05:45 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default

Well, a really good way is to dump the use of buttons, and make a custom
menu bar. After all, most windows software does have menu bars, and users
would find this nice.

You can read about my thoughts on this, and note the screen shots of
ms-access using menus bars in the following:

http://www.members.shaw.ca/AlbertKal...erFriendly.htm

And, the other approach is to place all the buttons on a sub-form, and then
just drop in this sub-form into any form that needs the buttons. Thus, you
get a instant re-useable component that you just drop in. I mention the idea
of making a re-usable form he

http://www.members.shaw.ca/AlbertKal...000000005.html

And, if you don't use a sub-form, you could use a popup form that stays
always on top, and again, the one form could then work for all forms...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.members.shaw.ca/AlbertKallal


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.