This should be an easy one.
I have the following code that works perfectly:
Dim r As Recordset
Set r = CurrentDb.OpenRecordset("tblTableNames")
r.MoveFirst
Do Until r.EOF
If Left(r!tablename, 4) <= "sqlA" Then
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=nod_database_v2;UID=Me;Trusted_Connection=Yes;APP=2007 Microsoft Office system;DATABASE=my_database", acTable, r!tablename, r!tablename
End If
r.MoveNext
Loop
What I want to do is instead of placing the tables into the current DB is to place r!tablename into another DB
which is: "C:\Users\Me\Documents\Test.accdb"
Thanks in advance
I have the following code that works perfectly:
Dim r As Recordset
Set r = CurrentDb.OpenRecordset("tblTableNames")
r.MoveFirst
Do Until r.EOF
If Left(r!tablename, 4) <= "sqlA" Then
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=nod_database_v2;UID=Me;Trusted_Connection=Yes;APP=2007 Microsoft Office system;DATABASE=my_database", acTable, r!tablename, r!tablename
End If
r.MoveNext
Loop
What I want to do is instead of placing the tables into the current DB is to place r!tablename into another DB
which is: "C:\Users\Me\Documents\Test.accdb"
Thanks in advance