Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tabeldefs to linked tables conversion

Status
Not open for further replies.

waely

Programmer
Dec 7, 2003
227
US
hi,
can some one help converting the codes from connection to local tables to linked tables. I have this piece of codes:
---------------------------------------------------
for each fld In dbs.TableDefs(tbls(tableNr)).Fields
backuptbl.fields.append backuptbl.createField(fld.name, fld.type)
Next fld
dbs.TableDefs.Append backup
---------------------------------------------------
I'm using linked tables now so I need to change tabledefs syntax. can someone help?

thanks in advance,
 

Hi,

If you have linked tables into your database, the linked tables have tabledefs a well as internal tables.
Code:
Sub test()
    Dim tdf As TableDef, fld As Field, dbs As Database
    Set dbs = CurrentDb
    For Each tdf In dbs.TableDefs
        For Each fld In tdf.Fields
             MsgBox tdf.Name & ":" & fld.Name
        Next fld
    Next
End Sub

Skip,
[sub]
[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top