When the add task button is pressed the form is supposed to collect the rest of the information for the record. The form opens and the serial number is added to the database however the rest of the field content on the form does not save
Private Sub AddTaskBttn_Click()
Dim Sn As String
Sn = Me.cmbSerialNumber.Column(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into Tasklist( SerialNumber ) Select '" & Sn & "' As Expr;"
DoCmd.SetWarnings True
DoCmd.OpenForm "Task", , , "Dockets.SerialNumber =" & "'" & Me.cmbSerialNumber.Column(0) & "'", acFormAdd
End Sub
On the Form Open of Task I have the following code
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Sn.Value = Me.OpenArgs
Me.Requery
End If
End Sub
On the task form I have the following save and close button
Private Sub FormClose_Click()
On Error GoTo Err_FormClose_Click
DoCmd.Save
DoCmd.Close
Exit_FormClose_Click:
Exit Sub
Err_FormClose_Click:
MsgBox Err.Description
Resume Exit_FormClose_Click
End Sub
Private Sub AddTaskBttn_Click()
Dim Sn As String
Sn = Me.cmbSerialNumber.Column(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into Tasklist( SerialNumber ) Select '" & Sn & "' As Expr;"
DoCmd.SetWarnings True
DoCmd.OpenForm "Task", , , "Dockets.SerialNumber =" & "'" & Me.cmbSerialNumber.Column(0) & "'", acFormAdd
End Sub
On the Form Open of Task I have the following code
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Sn.Value = Me.OpenArgs
Me.Requery
End If
End Sub
On the task form I have the following save and close button
Private Sub FormClose_Click()
On Error GoTo Err_FormClose_Click
DoCmd.Save
DoCmd.Close
Exit_FormClose_Click:
Exit Sub
Err_FormClose_Click:
MsgBox Err.Description
Resume Exit_FormClose_Click
End Sub