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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an array for import function

Status
Not open for further replies.

Seabz420

IS-IT--Management
Jul 14, 2003
129
CA
I have a form with a cmd button that imports data from another DB into my DB. I'm not to DB VBA coding so here is what I have (which works for one table):

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=XXXXXXXXXX", acTable, "DB1Table", "DB2Table", , False

Now, I have over 100 tables to import and rather then typing this code over and over for each table, I was thinking I might use 2 arrays. One for the DB1Table names and another for DB2Table. Then just pass that array names into the code. Would that work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top