help with insert into statement

  • Thread starter Thread starter short
  • Start date Start date
S

short

Can someone help me with what's wrong with this insert into statement?

SoftwareID = "SELECT Software.[ID] FROM Software where Software.[Name] = '"
+ cmbSoftware.Value + " AND ServerID = '" + ServerID = "';"
(this comes from a combo box)

nodeID = ID

Dim sql As String
sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
Values (""" & nodeID & SoftwareID & """)"
MsgBox sql
DoCmd.RunSQL sql
 
hi Shorty,
Dim sql As String
sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
Values (""" & nodeID & SoftwareID & """)"
MsgBox sql
DoCmd.RunSQL sql
Missing commas:

"INSERT INTO Node_Software([NodeID], [SoftwareID]) " & _
"VALUES ('" & nodeID & "', '" & SoftwareID & "')"


mfG
--> stefan <--
 
thanks so much!

Stefan Hoffmann said:
hi Shorty,
Dim sql As String
sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
Values (""" & nodeID & SoftwareID & """)"
MsgBox sql
DoCmd.RunSQL sql
Missing commas:

"INSERT INTO Node_Software([NodeID], [SoftwareID]) " & _
"VALUES ('" & nodeID & "', '" & SoftwareID & "')"


mfG
--> stefan <--
 
Back
Top