I am trying to pass multiple arguments from one form to another. The code for the first form is as follows:
Code:
Private Sub txtServerNm_Click()
Dim strSName As StringstrSName = Me.txtServerNm + "|" + Me.txtIPAddr
Debug.Print strSName
DoCmd.OpenForm "frmLogicalServerAdminSingleRec", , , , , , strSName
End Sub
The code form the receiving form is:
Code:
Private Sub Form_Load()
Dim strVal As String
Dim inPos As Integer
Dim ipVal As String
If Len(Me.OpenArgs) > 0 Then
inPos = InStr(Me.OpenArgs, "|")
If inPos > 0 Then
strVal = Left$(Me.OpenArgs, inPos - 1)
ipVal = Mid$(Me.OpenArgs, inPos + 1)
Me.txtServerNm = strVal
Me.txtIPAddr = ipVal
End If
End If
End Sub
DeBug.Print shows the expected arguments are in strSName. strSWName = Albatross|140.106.160.29
The problem is that OpenArgs is Null in the receiving form.
I have used this same code format in other forms and is works fine. Can anyone tell me why it doesn't work in this case?