A
ArielZusya
I've got a module which I call from all over my database. The module, stored
in basUniversals, is as follows:
Public Sub OpenFormAndClosePrevious(stDocName As String, Optional
stLinkCriteria As String, Optional stArgPasser As String)
On Error GoTo Err_MainMenu_Click
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , stArgPasser
Exit_MainMenu_Click:
Exit Sub
Err_MainMenu_Click:
MsgBox Err.Description
Resume Exit_MainMenu_Click
End Sub
And then in my form I attemted to call it as follows:
Dim stConcat as String
stConcat = "RefNum = '" me.txtRefNum & "'"
Call OpenFormAndClosePrevious("frmNext",stConcat, stConcat)
On every other form and even on this form assigned to another button, this
method works without problem. For whatever reason, I'm suddenly getting the
error message "ByRef Argument Type Mismatch" with no meaningful help. What
suddenly changed? What am I doing wrong? Thinking Access might have just
been more forgiving elsewhere I tried compiling the project and the only
error I received was on this one instance of this call. I just don't get it.
Thanks for your help!
in basUniversals, is as follows:
Public Sub OpenFormAndClosePrevious(stDocName As String, Optional
stLinkCriteria As String, Optional stArgPasser As String)
On Error GoTo Err_MainMenu_Click
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , stArgPasser
Exit_MainMenu_Click:
Exit Sub
Err_MainMenu_Click:
MsgBox Err.Description
Resume Exit_MainMenu_Click
End Sub
And then in my form I attemted to call it as follows:
Dim stConcat as String
stConcat = "RefNum = '" me.txtRefNum & "'"
Call OpenFormAndClosePrevious("frmNext",stConcat, stConcat)
On every other form and even on this form assigned to another button, this
method works without problem. For whatever reason, I'm suddenly getting the
error message "ByRef Argument Type Mismatch" with no meaningful help. What
suddenly changed? What am I doing wrong? Thinking Access might have just
been more forgiving elsewhere I tried compiling the project and the only
error I received was on this one instance of this call. I just don't get it.
Thanks for your help!