help with insert into statement

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
 
S

Stefan Hoffmann

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 <--
 
S

short

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top