D
Dick Schroth
You can just do it through a SQL statement, either one
row at a time or a whole recordset in one shot.
Something like:
' all at once
strSQL = "INSERT INTO TableB (Fld1, Fld2) SELECT Fld1,
Fld2 FROM TableA"
DoCmd.RunSQL strSQL
or
' one at a time
strSQL = "INSERT INTO TableB (Fld1, Fld2) Values ('" &
Var1 & "', '" & Var2 & "')"
DoCmd.RunSQL strSQL
For numeric fields you wouldn't enclose the variables in
single quotes. To get the values you want into the
variables you would have to open a recordset and loop
through it, but there are lots of examples in the VBA
help to show you how to do that.
Hope this helps!
Dick
row at a time or a whole recordset in one shot.
Something like:
' all at once
strSQL = "INSERT INTO TableB (Fld1, Fld2) SELECT Fld1,
Fld2 FROM TableA"
DoCmd.RunSQL strSQL
or
' one at a time
strSQL = "INSERT INTO TableB (Fld1, Fld2) Values ('" &
Var1 & "', '" & Var2 & "')"
DoCmd.RunSQL strSQL
For numeric fields you wouldn't enclose the variables in
single quotes. To get the values you want into the
variables you would have to open a recordset and loop
through it, but there are lots of examples in the VBA
help to show you how to do that.
Hope this helps!
Dick