Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: for each table in database loop?

    I have a naming convention on my tables, some start with "A", Some start with "B", i have others but these are the only tables i am concerned with.


    I would like to run an SQL statement that will work with each of the A tables and each of the B tables, so i need to get thier names dynamicly, how can i in my code get the names off all the A or B tables and add them to StrArrayA and StrArrayB??


    M~

  2. #2
    Join Date
    Jan 2004
    Posts
    40
    something like this, but this gives the system tables as well. not sure how to check if they are sytem tables or not, i'm sure its not too hard to find out.

    Dim asdf As Database
    Set asdf = CurrentDb
    Dim i As Integer

    For i = 0 To asdf.TableDefs.Count() - 1
    Debug.Print asdf.TableDefs(i).Name
    Next i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •