Consider this code. It works fine so long as I explicitly define the
table in the "Set tdf =" statement. What I want to do is the
equivalent of Set tdf = "dbs.TableDefs!" & strTableName. This of
course produces an error otherwise I wouldn't be posting this. How do
you use a variable in a Set Statement?
Dim dbs as Database
Dim tdf As TableDef
Dim fld As Field
SeT dbs = CurrentDB
Set tdf = dbs.TableDefs!tblRental THIS WORKS
Set tdf = dbs.TableDefs! & strTbleName THIS DOES NOT
For Each fld In tdf.Fields
Sent via Deja.com http://www.deja.com/
Before you buy.