I'm trying to create a table in an external database, that is based upon information found in a LINKED table from another
external database. However, there are a LOT of fields, and I'd rather not have to specifically declare and type each field
in a create table statement.
So, I thought, that i could Link the table temporarily and design a query off of it, that would include the specific fields I
wish to preserve from the linked table, and then use that query as the source for a Select Into statement. Thus I do this as
tdfLink = CurrentDB.CreateTableDef("MyTable")
tdfLink.Connect = ConnectStr
tdfLink.SourceTableName = "Table1"
' ... a bit later in another command button executed code
set dbTmp = CreateDatabase("NewDb.mdb", dbLangGeneral)
DoCmd.RunSQL "SELECT * INTO tbl_NewTable IN NewDb.mdb FROM qry_MyQuery;"
Now qry_MyQuery is designed off of the tabledef "MyTable" thus, when the program is dormant, there is no linked table
and qry_MyQuery is inaccessible. (causes errors about the missing source table)
However, at Run-Time, the source table is present, and the query will display in a datasheet view subform that i have on my
main form, but in the select into statement it creates an error.
Do I have to do EVERYTHING by hand with this, since the linked table is dynamically linked at run time?
Jaeden "Sifo Dyas" al'Raec Ruiner