All,
I have the following macro to insert data into a table but it is coming up with an run time error 3421 - data type conversion error.
Can anyone please tell me what is wrong with the code?
The SealType & Seal fields are Text and the Quantity & Qty are Number
Code:
Private Sub Machine_AfterUpdate()
Dim i As Integer
Dim Qty As Integer
Dim Seal As String
For i = 1 To 10
If (DLookup("Seal" & i, "SealQtyQry")) <> vbNullString Then
Seal = DLookup("Seal" & i, "SealQtyQry")
Qty = DLookup("Seal" & i & "Qty", "SealQtyQry")
CurrentDb.Execute "INSERT INTO SealStripDetail (SealType,Quantity) VALUES (Seal & ", " & Qty)"
End If
Next i
End Sub