Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Ontario
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List of tables (A2k)

    I need to create a list of tables as a drop down in a form. Does anyone have some code they can share?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: List of tables (A2k)

    Are you using DAO or ADO? The simple way is to query for tables in MSysObjects, but you need to specify the type. Local tables are type 1 and attached tables are type 6.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Jun 2002
    Location
    Ontario
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List of tables (A2k)

    Thanks!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: List of tables (A2k)

    As an addition to Charlottes reply: you will probably want to exclude system tables from the list. To do this, you can use this SQL string as Row Source:

    SELECT Name FROM MSysObjects WHERE (Type=1 Or Type=6) And Left(Name,4) <> "MSys"

    For an alternative using ADOX, see ACC2000: How to Fill a Combo Box with Table Names.

Posting Permissions

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