battenberg
Burning candles both ends
- Local time
- Today, 16:47
- Joined
- Sep 25, 2006
- Messages
- 118
I am trying write to a table the resuts of a selection from a combo box using the following SQL.
can anybody please help me with the correct syntax for this as I cannot get it working, and it's throwing up a syntax error.
Thanks
can anybody please help me with the correct syntax for this as I cannot get it working, and it's throwing up a syntax error.
Thanks
Code:
Dim sql As String
Dim strPartNumber As String
Dim strDescription As String
Dim strAHUuniqueID As String
'capture strings
strPartNumber = Me.Combo44.Column(0)
strDescription = Me.Combo44.Column(1)
strAHUuniqueID = Me.AHUuniqueID
sql = "INSERT INTO tblAncilleries ( PartNumber, ProductDescription ) VALUE ( " & strPartNumber & ", " & strDescription & " ) INNER JOIN tblAncilleries ON [tblAHU's].ProductID = tblAncilleries.ProductID WHERE ((([tblAHU's].AHUuniqueID) = " & strAHUuniqueID & ")) "
MsgBox "SQL:" & vbCrLf & vbCrLf & sql
'DoCmd.RunSQL sql