Passing parameters using OnAction

Schof

Registered User.
Local time
Today, 04:40
Joined
Nov 15, 2002
Messages
44
I have created a function (below) that opens a form (whose name is passed to the function in a variable) and passes in an argument (whose value is also passed to the function in a variable).

Public Function doCmdOpenForm(formName As String, openArgs as string)

DoCmd.openForm formName,,,,,, openArgs

End Function

I would like to call the function using a menu item's OnAction property. I have tried many different methods but cannot get it to work.

For Example:

=doCmdOpenForm(""My Form"", ""My OpenArgs"")
='doCmdOpenForm ""My Form"", ""My OpenArgs""'
='doCmdOpenForm(""My Form"", ""My OpenArgs"")'

None of these work. Anyone know how this can be done? Please note that I want to customize the menu item using MS-Access's GUI and not through VB code.
 
=doCmdOpenForm("My Form", "My OpenArgs")

Too many quotes, duh!!!
 

Users who are viewing this thread

Back
Top Bottom