I am trying to add a record to a child database by inserting the serial number that the user chooses in the combo.
Private Sub Combo40_AfterUpdate()
Me.RecordsetClone.FindFirst "SerialNumber = '" & Combo40 & " '"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Private Sub AddTaskBtn_Click()
Dim sSQL As String
Dim dbs As Database
Set dbs = CurrentDb()
DoCmd.OpenForm "Task", , , "[TaskList.SerialNumber] =" & "'" & Me.Combo40.Column(0) & "'"
dbs.Execute "Insert Into TaskList(SerialNumber) Values ('" & Combo40 & "')"
End Sub
Once the serial number is chosen a task form opens and the user types in the task. I can't seem to get the chosen serial number into the child database. When the user exits the form, an error says that it can't save the record because the serial number is null. When I used the debug window while I ran the code line by line, the serial number did have a value.
Private Sub Combo40_AfterUpdate()
Me.RecordsetClone.FindFirst "SerialNumber = '" & Combo40 & " '"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Private Sub AddTaskBtn_Click()
Dim sSQL As String
Dim dbs As Database
Set dbs = CurrentDb()
DoCmd.OpenForm "Task", , , "[TaskList.SerialNumber] =" & "'" & Me.Combo40.Column(0) & "'"
dbs.Execute "Insert Into TaskList(SerialNumber) Values ('" & Combo40 & "')"
End Sub
Once the serial number is chosen a task form opens and the user types in the task. I can't seem to get the chosen serial number into the child database. When the user exits the form, an error says that it can't save the record because the serial number is null. When I used the debug window while I ran the code line by line, the serial number did have a value.