DylansStrings
New member
- Local time
- Today, 06:32
- Joined
- Sep 12, 2012
- Messages
- 4
Hi I have a basic insert query as below.
basically inserting from another table where ColumnA matches the entered parameter [value]
I have about 500 values to enter from a list or a table though and I wanted to use VBA to loop through the list of values and insert into the tableA for each value. Would I need to use docmd.runSQL enclosed in a foreach loop or loop through the values in a recordset.
Any recommendations would be helpful thanks.
thanks
basically inserting from another table where ColumnA matches the entered parameter [value]
I have about 500 values to enter from a list or a table though and I wanted to use VBA to loop through the list of values and insert into the tableA for each value. Would I need to use docmd.runSQL enclosed in a foreach loop or loop through the values in a recordset.
Any recommendations would be helpful thanks.
Code:
INSERT INTO tableA ( columnA, columnB )
SELECT tableB.ColumnA, tableB.columnB
FROM tableB
WHERE ((tableB.ColumnA)=[Value])
thanks