M
Matt
Hi All,
I have the current Sub Procedure in a VBA Module.
-----------------------------------------------------------------------------------------------------------------------------
Sub openForm(formName As String, Optional varToSend As Object)
If varToSend Is Missing Then
DoCmd.openForm formName
Else
DoCmd.openForm formName, , , , , , varToSend
End If
End Sub
----------------------------------------------------------------------------------------------------------------------------
But when I call: openForm("frmEmployeeAdjust",empNo) - I get an Error
"Expected: = "
I know I could just write the code in the button and everything would
work, but I would like to write this simple function that I could call
anytime I needed to open a form. I always thought Object was generic
enough to contain any data type that exists, so I should be ok weather
I pass an Integer, String, Etc. Am I doing something blantantly wrong
here?
As always, Thanks in advance for all of your help!
I have the current Sub Procedure in a VBA Module.
-----------------------------------------------------------------------------------------------------------------------------
Sub openForm(formName As String, Optional varToSend As Object)
If varToSend Is Missing Then
DoCmd.openForm formName
Else
DoCmd.openForm formName, , , , , , varToSend
End If
End Sub
----------------------------------------------------------------------------------------------------------------------------
This Works GreatFrom a button on "frmDash" I call: openForm("frmEmployeeAdjust") -
But when I call: openForm("frmEmployeeAdjust",empNo) - I get an Error
"Expected: = "
I know I could just write the code in the button and everything would
work, but I would like to write this simple function that I could call
anytime I needed to open a form. I always thought Object was generic
enough to contain any data type that exists, so I should be ok weather
I pass an Integer, String, Etc. Am I doing something blantantly wrong
here?
As always, Thanks in advance for all of your help!