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?
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?