S
Saturn
Hi!
Trying to add many records to a table triggered by a
button clicked on a form. The values for the fields will
be mostly hard coded, and a few fields on each record will
come from fields on the form. This is what was suggested
to me as an example to insert one record:
Private Sub CreateSystem_Click()
Dim newrec As String
newrec = "INSERT INTO Components (Components.Customer_ID,
Components.Component_ID, Components.Unit_Cost) VALUES
(40,266,3750)"
CurrentDb.Execute newrec
End Sub
I've tried many variations on this but I either get a
syntax error on the "INSERT INTO" statement, or it tells
me that the Components_ID field is invalid (both with and
without the "Components." prefix). Please provide a
possible solution to this approach or suggest another
approach. Thanks!!!
Trying to add many records to a table triggered by a
button clicked on a form. The values for the fields will
be mostly hard coded, and a few fields on each record will
come from fields on the form. This is what was suggested
to me as an example to insert one record:
Private Sub CreateSystem_Click()
Dim newrec As String
newrec = "INSERT INTO Components (Components.Customer_ID,
Components.Component_ID, Components.Unit_Cost) VALUES
(40,266,3750)"
CurrentDb.Execute newrec
End Sub
I've tried many variations on this but I either get a
syntax error on the "INSERT INTO" statement, or it tells
me that the Components_ID field is invalid (both with and
without the "Components." prefix). Please provide a
possible solution to this approach or suggest another
approach. Thanks!!!