active screen

W

wayne.coldwell

I have a macro that runs some code for a particular
screen. I put this code in a menu. My problem is now that
if the user is on the wrong screen and goes up to the new
menu and selects that macro I get an error. I have tried
to make the menu only appear when the desired screen is
active, but I am having some problems. I need to either
completely disable the menu on other screens or have some
code that checkes to see if the correct screen is active.

any advise would be helpfull.

Thanks

Wayne
 
M

Microsoft News Groups

Wayne,

In VBA it would be easy to test if the active form was the appropriate one.

If Screen.ActiveForm.Name = "Right Name" Then
do action
Else
ignore
End if

I don't know if you can do this in macros.

You can call a function from a menu option; you put the function name in the
On Action box of the Menu Bar Control Properties dialog. This would allow
you to use VBA code.

Rod Scoullar
 
W

Wayne

Rod
Thanks so much for the insight. I will try it. I had
tried it earlier, but I think I had the syntax wrong.
 

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