Feb 1, 2006 #1 DanSc0tt MIS Sep 17, 2001 30 DE Hi, Trying to find a way of creating a table and then filling it with values from an array. Have tried Docmd.runsql "select into tblName values " & ArrayName but this doesn't work Any ideas of 1/ How to fix it? 2/ To do it a simpler way? Thanks
Hi, Trying to find a way of creating a table and then filling it with values from an array. Have tried Docmd.runsql "select into tblName values " & ArrayName but this doesn't work Any ideas of 1/ How to fix it? 2/ To do it a simpler way? Thanks
Feb 1, 2006 #2 AlexMidd Programmer May 14, 2001 655 NL The SQL should be "INSERT INTO [TableName] VALUES {Array elements separated by commas}" A lot depends on whether your array is one-dimensional or more and how many fields in the table you want to insert the values into. Have fun! ) Alex Middleton Upvote 0 Downvote
The SQL should be "INSERT INTO [TableName] VALUES {Array elements separated by commas}" A lot depends on whether your array is one-dimensional or more and how many fields in the table you want to insert the values into. Have fun! ) Alex Middleton
Feb 1, 2006 Thread starter #3 DanSc0tt MIS Sep 17, 2001 30 DE ugh still giving me a syntax error. I have this as a part of a loop and so each time it loops I want it to paste in the individual value in the array hence DoCmd.RunSQL "Insert into tbltest.Test values {" & strArray2(z) & "}" any more ideas? Thanks! Upvote 0 Downvote
ugh still giving me a syntax error. I have this as a part of a loop and so each time it loops I want it to paste in the individual value in the array hence DoCmd.RunSQL "Insert into tbltest.Test values {" & strArray2(z) & "}" any more ideas? Thanks!