Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Question Unanswered: How can I look things up in a closed table

    I'm intending to look up the table names in the system object table to check the existence of a table requested by the user. Basically if the table exist then the it will loaded into a form which is predesigned. If the doesn't exist then a message will pop up and say that the table doesn't exist. I know that you can get around this problem using On Error, but I would like to know if there anything else I can use, i.e. look it up somewhere. Can anyone help?

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: How can I look things up in a closed table

    Originally posted by Camford
    I'm intending to look up the table names in the system object table to check the existence of a table requested by the user. Basically if the table exist then the it will loaded into a form which is predesigned. If the doesn't exist then a message will pop up and say that the table doesn't exist. I know that you can get around this problem using On Error, but I would like to know if there anything else I can use, i.e. look it up somewhere. Can anyone help?
    Maybe you can use this as a start :

    Code:
    Public Sub test()
        Dim myDB As database
        Dim table As tableDef
        
        Set myDB = DBEngine.Workspaces(0).Databases(0)
        Debug.Print myDB.Name
        
        
        For Each table In myDB.TableDefs
            Debug.Print table.Name
        Next table
    End Sub
    It displays the names of all tables of your current db (including system tables)

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    Thanks for your help.

Posting Permissions

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