Passing OpenArgs from a macro

  • Thread starter Thread starter dat
  • Start date Start date
D

dat

Hi,

I'm trying to open a form from a macro-based menu. I'd like to open the
same form for different menu items, but show/hide controls according to the
menu selection, so I need to send OpenArgs from the macro to the form. Any
idea how to do that please?

Thanks
 
Hello.

dat said:
I'm trying to open a form from a macro-based menu. I'd like to open
the same form for different menu items, but show/hide controls
according to the menu selection, so I need to send OpenArgs from
the macro to the form. Any idea how to do that please?

You can't.
But you can use the RunCode macro action to execute a function that
is placed in a standard module. You could pass your OpenArgs as an
argument to that function and let the function open the form using it's
argument as the OpenArgs argument of the DoCmd.OpenForm method.
Simple Example:

Function OpenTheForm(OpenArgs)
DoCmd.OpenForm FormName:="TheForm'sName", OpenArgs:=OpenArgs
End Function
 
Thanks a million Wolfgang..

This was really a perfect solution.. I applied it and worked just fine.

Regards
 
Back
Top