active screen

  • Thread starter Thread starter wayne.coldwell
  • Start date Start date
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
 
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
 
Rod
Thanks so much for the insight. I will try it. I had
tried it earlier, but I think I had the syntax wrong.
 
Back
Top