referencing a menuitem in a function on a module

davecarrr
davecarrr used Ask the Experts™
on
I want to create a function in a module that can be called from a child form to check an item in a form.

e.g.

Form:

private sub Button1_click()
        Selectform MnuForm1
end sub


Module :

Public sub Menuhandler(menuitem)
        set tmp = menuitem
        tmp.checked = true
end sub

thanks

Dave
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Did you try this:

Module :

Public sub Menuhandler(byRef menuitem as Menu)
'   dim tmp as Menu
'   set tmp = menuitem
'   tmp.checked = true
   menuitem.Checked = True
end sub

Author

Commented:
thanks for your efforts, but i've managed to solve the problem myself, the above method works with the exception that when passing the menuitem to the module sub, it needs to be properly addressed with the main form prefix.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial