Access 2000 Customise Toolbar no longer allows you to call a function

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

In Access 97, you could customise the programming
environment to call a your own vba function.
(View>Toolbars>Customize>Shortcut Menus>Commands>File> and
drag the "Custom" statement into the Module Compiled or
Module Uncompiled shortcut menu. Then type the name of
the function you want to call.)
Although you still can do this in the database window in
Access 2000, it has no effect. The Access 2000 Code
environment now has it's own shortcut toolbar; but if you
try to alter it, the "Custom" statement is missing.
Does this mean we can no longer customise the programming
environment with our own tools?
 
Gee, the only way I ever had a menu item call a function is as follows:


add a new custom menu. Then drag the "custom" option form the commands
window.

You then can set the text, icon. To run code, you simply right click, and
select the properties. In the on-action setting, you place your function.

=MyFunctionName()


I always done the above in a97, and it works fine in a2000.

I don't know why you would be messing with the module compiled, or module
uncompelled shortcut menu, but I would not use them, and stay away from that
all together.

You ALWAYS want to create your own new custom menus, and not mess with the
built in ones.

Here is a tutorial for a97, and it applies equally well to the later
versions.

http://www.microsoft.com/Accessdev/articles/bapp97/chapters/ba01_6.htm
 
Thanks Albert,I know this seems strange but I have really
good reasons to mess around in the code window. I am
familiar with the CommandBars Collection Object; I know
how the user interface in A97 works, and I have developed
VBA code that automatically deletes and/or inserts my
tools into the Shortcut menu for the code window - in A97.
It all works a treat in A97.

I take your point on not messing with built in command
bars, and agree with it so long as it doesn't hinder my
requirement for a better shortcut menu for the code
window. I do nothing but write code for large Access
systems, and some years ago decided to tailor the code
interface to make things easier for myself. Access 97, or
2000, or XP, simply does not provide me with the tools I
want. And as no unauthorised people will ever get to see
these tools - this is proprietary code that belongs to
me - I see no reason to treat the shortcut menu with any
particular reverence.

But this is all irrelevant to my problem anyway. I don't
seem to be able to create even a new menu bar that will do
what I want in the *code* window, in A2K. I can't do the
=MyFunctionName() thing. It's not the same animal as in
A97. The database window customisation is the same, and
implies - by the presence of the Module Compiled and
Module Uncompiled menus - that you can change them.
But in fact if you do change them, you never get to
execute them in A2K. Try it. Make a change to the module
uncompiled menu as you suggest below and open some code
and change it. Then right click - you might expect
the "module uncompiled" shortcut to pop up - but the
shortcut menu is different from A97 and seems to indicate
that the vba window is now separated somewhat from the
database objects.
Or, maybe my instal of A2K is bad. Can you do me a favour -
are you able to put up a new command bar in the code
window and specify =MyFunctionName() as an action, in
A2K? XP? If you can do it, I've obviously missed
something very basic here and ... apologise in advance!
 
No doubt the menu bars in a2000 and later for the VB IDE are different. I am
sure you realize that the VB IDE is now separate.

In fact, you don't get the "properties" when you right click on a menu item
in the VB IDE now. (I did not know that).

Thus, I suspect you will have to use code to add your menu item. (since 3rd
party tools mztools do add their own menu items to the vb IDE, then no
doubt, so can you).

By the way, if you have not yet tried mz-tools, it is fabulous free add in.
(it gives all kinds of cool vb extras). For example, while in a piece of
code, you can whack a key, and it tells you WHAT OTHER CODE in your
application calls the current routine (truly one of the best slick free add
in for vb, and vba). It also gives stuff like line counts, error builders
etc.

Check out:

http://www.mztools.com/

Anyway, it would seem that you can't right click, and set the properties in
the vb ide. So, since as you mentioned you often used code...that should
work.
 
OK thanks for your patience Albert.
I'll check out mztools - sounds like something I should
have, and I'll keep you posted on the add-ins approach.
Terry Bell
(e-mail address removed)
Melbourne, Australia
 
Thus, I suspect you will have to use code to add your menu item.
(since 3rd party tools mztools do add their own menu items

COM objects, not pointers to VBA code in the Access project....

(david)
 
Back
Top