shortcut menu (popup)

S

Souris

I created a shortcut (poopup) menu for the form.

It works fine when I created and tested.
The shortcut function execute.

For some reason it dees not execute the function any more.
I did not change any progam or code.

Are there any possible that the shortcut menu Access does not do any more?
I use Access 2003.

Your information is great appreciated,
 
A

Albert D. Kallal

Souris said:
I created a shortcut (poopup) menu for the form.

It works fine when I created and tested.
The shortcut function execute.

For some reason it dees not execute the function any more.
I did not change any progam or code.

Well obviously something must have changed, we just don't know what yet.
You've not given a lot of information to go on, and so far we simply have
something akin to that of my car does not work anymore, and you didn't
change anything.

Regardless of you not having changed anything to your car, the information
that the car "doesn't start" helps little. In the case of the car, we would
look at things like is there fuel?, is the battery ok? Did someone come
along and steal the motor? As you can see, without some process of
reasoning and troubleshooting we can't solve anything. I suspect you not
changed anything to that car, but you can see there's quite a long list of
things that would prevent the car from starting, despite the fact that you
not having changed anything in your car.
Are there any possible that the shortcut menu Access does not do any more?
I use Access 2003.

At this point in time we simply have information that this does not work.

However, lets start a troubleshooting process to determine when your car
doesn't start, or in this case a menu that don't work.

The first thing I would ask is does your menu bar call/run a macro, or does
it call the VBA code directly? Or, is the button based on a built-in button
(so, we have 3 possible types of buttons here as to what happens when it is
clicked on). As a general rule most of my custom menu bars button do call
code directly. This means you set the on-action of the button as a public
VBA function in the on action setting eg:

=NameOfFunction()

Keep in mind that if your button is calls a public VBA function, then there
is a significant difference as to whether you place the code it calls for in
the current form, or in a standard "module? (so, you have to answer this
question). note that if you place the public function in a form's code
module, then the form must have the focus when you click on your custom menu
button. Note that if that form is not open any more (or does not have the
focus), then the button will NOT work anymore. So, your failure of your menu
bar could be something as simple as a form not being open any more, or not
having the focus. Do check this two significant details.

Note that another possible reason for failure is that you re-named the form,
or you modified your code in your application (the function is set as being
NOT public anymore. You also could have simply deleted some code by
accident. This would apply to both actual VBA code. if your button is not
called VBA, but calls a macro, then it also possible that you renamed or
deleted the macro used by the menu bar button.

It is also possible that your menu button is actually a copy of, or is based
on one of the built in menu bars. Note that often many of these built in
menu bars are what we call context sensitive. In a nutshell this simply
means that your menu bar button will ONLY function in certain contexts. For
example, if your button is based on the "paste" button, you will notice that
if you have nothing to paste, then the button does nothing (in fact, you
find the button is not even enabled in that case).

so I would check the above issues. In summary:

-- is this a built in button (is it based on a built in button) ? if yes,
then keep in mind the context issues mentioned above

-- is this button call a macro? Where is the macro code? (check for rename,
deletion of that macro code). Did you delete some object or something that
the macro needs? In other words you may not have modified the macro, but you
may have modified, or even deleted an object that the macro needs (such as
launching a report or form, if the report/form was re-named, then this would
case the button macro to fail).

-- does this button call VBA code? (again, form loaded, where is the code
for the button, in a form's module, or a standard code module?)

-- If you re-create the button on a test menu bar, does the code this
button uses run correctly? (this one is probably the easiest to test, and
would be one of the *first* things you try. So, try recreating the button on
a test menu bar and see if it works)

there's probably several more things that we could try it, but it's likely
better we gets a bit of feedback as to what you've tried so far. (it doesn't
make sense for me to tell you to try and start the car if you've not checked
if the battery has no electricity for example).

So, try/check some of the above suggestions. Try re-creating the button on a
test menu, and see if it works.

it also not clear at this point if the context menu is displaying, but NOT
running your code when you click on the button, or if in fact the problem is
the context menu don't display at all (perhaps you changed your form to a
acDialog form...and I don't believe context menus function in this case).
 
S

Souris

Thanks for the message,
I had a project using Access 2000 which works fine for shortcut menu.

This one I use Access 2003. The shortcut menu works when I writing code, but
it does not work when I implement the Access application.

I tried to delete them and re created them and compact and repaired the
database. I still get same result.

It must something changed I do not know,

Any information is great appreciated,
 
S

Souris

I have 5 menu on my shortcut menu.
Only the first one and last one work.

I set break point on the module code.

Only first one and last one break point stop.
It seems the middle 3 menu does not execute the code at all.
I use copy and paste the function name from the module.
It should have exactly spell of the function name.

Any thing I need check here?
Your information is great appreciated,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top