S
short
I have a database that the users want to have a seperate table that holds the
primary keys of two other tables. So I create a table with both tables
primary keys in it:
Software_Node
NodeID
SoftwareID
(made both pk both numbers)
which is connected to the Software and Node tables by their pk's.
Now on the node form I have it where the user selects the software, and then
enters the node and then pressed a button to add the node which is supposed
to put in the PK's of the tables. So this is my code: (I posted this a few
days ago, but am now getting an error)
Private Sub cmdNode_Click()
Dim NodeID As Integer
Dim SoftwareID As Integer
NodeID = ID
SoftwareID = "SELECT Software.[ID] FROM Software where Software.[Name] = '"
+ cmbSoftware.Value + " AND ServerID = '" + ServerID = "';"
Dim sql As String
sql = "INSERT INTO Node_Software([NodeID], [SoftwareID]) VALUES ("" &
NodeID & "", "" & SoftwareID & "")"
MsgBox ("You have added a node")
DoCmd.RunSQL sql
End Sub
I keep getting an error message that MS Access can't append all the records
in the appened query.. set 1 field(s) to Null due to conversion failure
anyone have any idea what I did wrong?
primary keys of two other tables. So I create a table with both tables
primary keys in it:
Software_Node
NodeID
SoftwareID
(made both pk both numbers)
which is connected to the Software and Node tables by their pk's.
Now on the node form I have it where the user selects the software, and then
enters the node and then pressed a button to add the node which is supposed
to put in the PK's of the tables. So this is my code: (I posted this a few
days ago, but am now getting an error)
Private Sub cmdNode_Click()
Dim NodeID As Integer
Dim SoftwareID As Integer
NodeID = ID
SoftwareID = "SELECT Software.[ID] FROM Software where Software.[Name] = '"
+ cmbSoftware.Value + " AND ServerID = '" + ServerID = "';"
Dim sql As String
sql = "INSERT INTO Node_Software([NodeID], [SoftwareID]) VALUES ("" &
NodeID & "", "" & SoftwareID & "")"
MsgBox ("You have added a node")
DoCmd.RunSQL sql
End Sub
I keep getting an error message that MS Access can't append all the records
in the appened query.. set 1 field(s) to Null due to conversion failure
anyone have any idea what I did wrong?