Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Way to Create a Table from an Array

Status
Not open for further replies.

DanSc0tt

MIS
Sep 17, 2001
30
0
0
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
 
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! :eek:)

Alex Middleton
 
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top