This SQL copies a table to an external database and names it “expTable”:
strSQL = “SELECT CHB_LP_Master_Table_Previous.* INTO expTable” _
& ” IN ‘W:PNCADVSpecial AssetsCHBCHB_ARCHIVES.mdb'” _
& ” FROM CHB_LP_Master_Table_Previous”
The problem is “expTable” is supposed to be the variable not the table name. I forgot the quotes of course. So I correct the SQL and low the variable is recognized and holds the proper table name:
strSQL = “SELECT CHB_LP_Master_Table_Previous.* INTO ‘” & expTable & “‘” _
& ” IN ‘W:PNCADVSpecial AssetsCHBCHB_ARCHIVES.mdb'” _
& ” FROM CHB_LP_Master_Table_Previous”
Now I get an error “Incomplete Query clause”.