Mega Code Archive

 
Categories / VisualBasic Script / Access
 

Use DBEngine to reference tables and its columns

Sub exaCollections()     Dim colParent As New Collection     Dim colChild As New Collection          Dim tdfBooks As TableDef     Dim objVar As Object          Set tdfBooks = DBEngine(0)(0).TableDefs!BOOKS     colParent.Add colChild     colParent.Add tdfBooks     Debug.Print colParent.Count     For Each objVar In colParent         If TypeOf objVar Is Collection Then             Debug.Print "Collection"         ElseIf TypeOf objVar Is TableDef Then             Debug.Print objVar.Name         End If     Next End Sub