Avatar of netmergence
netmergence
Flag for United States of America asked on

Using VB in MS Access to Insert Multiple Rows from a Query into a Table

I need to be able to insert muliple rows returned by a query into a seperate table, using VB code.

ie, when I click a button, it executes the query in the background. The query returns somewhere between 2 - 10 lines, each of which need to be inserted into a seperate table.

I have tried using DoCmd.RunSQL and Insert Into, but I can't seem to get it to work. (I assume I can only insert one row at a time using this.)

I was thinking about executing my query into a 2D array, then inserting each line into the database one at a time, but I wonder if there isn't an easier way.

Any ideas?
Microsoft AccessVisual Basic ClassicSQL

Avatar of undefined
Last Comment
netmergence

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
netmergence

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes