Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you view the logic behind a custom menubar

Status
Not open for further replies.

rlh145

Programmer
Feb 19, 2001
36
US
I have a custom menubar that I need to observe the code that is set up behind each selection on the menubar. I don't do this very often and I have forgotten how to do this. Can someone help me? I hope that I have been clear in what I am asking for.

Thanks for any help!!
 
Menu bars have code, just like any other control. to "observe", is perhaps ambigious, but either seta break points where you are interested or generate a 'trace; routine and instrument the code to generate the trace information you need. I, when using the trace functionallity, always include a global boolean to turn the trace on/off. I also usually set up a set of additional (global) booleans for specific areas of interest and have a form to turn these on/off. Allows me to implement the trace function generically, but collect the info on subsets of the instrumented modules. There is some overhead to this, but I usually leave the entire process in even production level applications.




MichaelRed


 
I think the question is:

how do I get to the code editor to see the code behind each of the events in a custom menu bar?


I don't do much in Access, but hopefully this will help someone who does know the answer to provide it.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
I just checked one of my old Excel workbooks that has a custom toolbar. Not sure if it's the same in Access (it probably is), but to find out which macro/subroutine is attached to a button on the toolbar:

1. Right-click on any toolbar, choose "Customize..."
2. This opens a dialog box, which needs to be open in order to get the right context menu for the toolbars (otherwise, you can ignore it)
3. Now right-click the button on the custom toolbar and choose "Assign macro...". This will open another dialog showing you which macro/subroutine is currently attached to that button.

How's that for intuitive?

I know you asked about custom menu-bars, not toolbars, but I *think* it's basically the same.
 
How are ya rlh145 . . .
rlh145 said:
[blue]I have a custom menubar that I need to observe the code that is set up behind each selection on the menubar . . .[/blue]
Custom MenuBars [blue]specifically call functions[/blue] contained in modules in the modules window. It is these functions you are talking about.

To find out the function called for any menu button:
[ol][li]Click [blue]Tools[/blue] - [blue]Customize[/blue].[/li]
[li]Click the menu of interest then right-click the button of interest.[/li]
[li]Click properties at tthe bottom.[/li]
[li]Have a look at the [blue]On Action[/blue] property to see the function called. Then find it in your modules.[/li][/ol]


Calvin.gif
See Ya! . . . . . .
 
I appreciate all that responded!! Each one of you helped me and I got what I needed. I do apologize for not explaining myself well enough. I know what I want or need but sometimes I can't explain it well enough for folks that are hard core techies!

Thanks again!!

RLH145
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top