calling pub function from Menubar

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have set coded some public function and am trying to call them directly
from a custom menu bar, but I get an error saying dbname can't run the macro
or callbackfunction "functionname()"

When I create a macro that uses "run Code functionname()" and call this from
the menu bar the module runs. Do I have to create a macro for every custom
menu I want to call?

I am putting the functio name in the onAction box in the menu properties in
the format functionname().

Chris
 
Chris,

I so wish there was a Pub function - it would be great ! :-)

Anyway, two things on this. For this to work, the procedures must be Public
Function - not Public Sub. And then you place =SomeFunction() in the on
action box. The following example is for a procedure named GetDrink - u have
got me started now....

Public Function GetDrink()

' Code goes here for function

End Sub

=GetDrink() will then go in the On Action box of the menu button.

HTH,

Neil.
 
Back
Top