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.
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.