I have 2 tables. One is dockets and the other is tasks. Each docket could have many tasks. The primary key in dockets is DSerialNumber. The relationship is to TSerialNumber. I have a form with a combo box. If the user wants to add a task for a certain docket he chooses the correct serial number from the combo. Then it is supposed to add a record to the task (child) table based on that serial number. It does so with the insert sql command. But I want to open a form to fill out the rest of the fields and I am having a problem passing the variable to the form.

It seems to me that when I open the form only the sn has the right value. The openargs is null as well as the TSerialNumber. The insert SQL command is creating a new record with the Tserialnumber. The form is saving a new record with the rest of the fields. How can I get the form to fill the record that is created by the Insert command. I assumed the dlookup would get me to the right record.

I have a command button on a form to add a task
Private Sub AddTaskBttn_Click()
Dim Result As String
Dim Sn As String
Sn = Me.cmbDSerialNumber.Column(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into Tasklist( TSerialNumber ) Select '" & Sn & "' As Expr;"
Result = DLookup("[TSerialNumber]", "TaskList", "[TSerialNumber]='" & Sn & "' ")
DoCmd.OpenForm "Task", acNormal, , "TaskList.TSerialNumber" = Sn, acFormAdd, acDialog, Sn

DoCmd.SetWarnings True
End Sub
On the task form I have the following procedure
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Sn = Me.OpenArgs
Sn = Me![TSerialNumber]
Me![TSerialNumber] = Me.OpenArgs
Me.Requery
End If
End Sub