Passing OpenArgs from a macro

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
 
W

Wolfgang Kais

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
 
D

dat

Thanks a million Wolfgang..

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

Regards
 

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