I have two forms, say frm1 and frm2. In a control on frm1, in the on click event, I have the following:
DoCmd.OpenForm "frmAddServicestoDT", , , , , , Me.cboServerNm
In frm2, in the Form_Load sub, I have the following:
Dim strServerName As String
strServerName = Me.OpenArgs
If Len(strServerName) > 0 Then
Me.txtSName.Value = strServerName
Else
myMsg = MsgBox("You must supply a server name!", vbInformation, "Invalid Server Name")
Cancel = True
DoCmd.GoToControl "txtSName"
End If
In debugging, I confirm that me.cboServerNm has a legitimate string. However, the strServerName = me.OpenArgs expression give a Run-time error '94': Invalid use of Null. I have tried using the On Open event instead of On Load for frm2, but get the same error. Does anyone know what I am doing wrong?