I looked more closely at the SQL syntax Steve put together and tried this:
Code:
Private Sub cmdSaveNext_Click()
Dim sSQL As String
' need to check the controls on the form to ensure controls are not null
' create Append SQL string
sSQL = "INSERT INTO tblCellFreezerLog ( cellassayFK, freezerFK, FreezeDate, Cane, Box, BoxColumn, BoxRow, BarcodeID )"
sSQL = sSQL & " WHERE cellassayFK = " & Me.cboHostCell & " AND " & Me.cboFusionPartner & " AND " & Me.cboKinase & " AND " & Me.cboAllele & " AND " & Me.cboDerivationMethod & "'"
sSQL = sSQL & " VALUES(" & Me.cboHostCell & ", " & Me.cboFusionPartner & ", " & Me.cboKinase & ", " & Me.cboAllele & ", " & Me.cboDerivationMethod & ", "
sSQL = sSQL & Me.cboFreezer & ", #" & Me.tbFreezeDate & "#, " & Me.tbCane & ", " & Me.tbBox & ", " & Me.tbColumn & ", '" & UCase(Me.tbRow) & "', '" & Me.tbBarcode & "');"
Debug.Print sSQL
CurrentDb.Execute sSQL, dbFailOnError
DoEvents
Me.tbBarcode = vbNullString
Me.tbBarcode.SetFocus
Call IncrementSlot
End Sub
I was foolishly optimistic. My reward was "Runtime error 3134 Syntax error in INSERT INTO statement".
If I debug, then it points to this statement:
Code:
CurrentDb.Execute sSQL, dbFailOnError
The voices warned me this would happen.