VBA/Excel/Access/Word/Access/CurrentData

Материал из VB Эксперт
Перейти к: навигация, поиск

Loop through all queries in the database referenced by the CurrentData object.

   <source lang="vb">

Sub IterateAllQueries()

   Dim vnt As Variant
   With CurrentData
       For Each vnt In .AllQueries
           "Print the name of the table
           Debug.Print vnt.Name
       Next vnt
   End With

End Sub

</source>
   
  


Loop through each table in the database by the CurrentData object

   <source lang="vb">

Sub IterateAllTables()

   Dim vnt As Variant
   With CurrentData
       For Each vnt In .AllTables
           "Print the name of the table
           Debug.Print vnt.Name
       Next vnt
   End With

End Sub

</source>
   
  


Loop through each table in the database referenced by the CurrentData object

   <source lang="vb">

Public Sub GetDates()

   Dim vnt As Variant
   With CurrentData
       For Each vnt In .AllTables
           Debug.Print vnt.Name & ", " & vnt.DateCreated & ", " & vnt.DateModified
       Next vnt
   End With

End Sub

</source>