OpenArgs and Tabbed subforms (1 Viewer)

thart21

Registered User.
Local time
Yesterday, 18:15
Joined
Jun 18, 2002
Messages
236
I have been using the below code successfully with a main form and one subform. Now I have made it a main form and 3 tabbed subforms (just the original Subform data split up into 3 categories) The form "NIL" just comes up blank after vbYes and I get the message "Cannot assign a value to this object", and the VBA code highlights my NIL Load code. Could this have anything to do with my Tabbed subforms?

Not in List form:

Private Sub Form_Load()
If Len(Me.OpenArgs) > 0 Then
Me.DocNumber = Me.OpenArgs[/COLOR
End If


Not In List event of Add Records form

Private Sub DocID_NotInList( _
NewData As String, Response As Integer)
Dim mbrResponse As VbMsgBoxResult
Dim strMsg As String

strMsg = NewData & _
" isn't an existing Document. " & _
"Add new Document?"
mbrResponse = MsgBox(strMsg, _
vbYesNo + vbQuestion, "Unrecognized Document or Training")
Select Case mbrResponse
Case vbYes
DoCmd.OpenForm "NIL", _
DataMode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=NewData



If IsLoaded("NIL") Then
Response = acDataErrAdded
DoCmd.Close acForm, "NIL"
Else
Response = acDataErrContinue
End If
Case vbNo
Response = acDataErrContinue
End Select
End Sub

Thank you for you help as always!!
 

Users who are viewing this thread

Top Bottom