Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2002
    Location
    Inland Northwest(US)
    Posts
    19

    Question Unanswered: Detecting Tables from code

    How do I detect if a table exists from a module of code? I want to create it if it doesn't but not bother if it does.
    Thanks
    Laeskia

  2. #2
    Join Date
    Feb 2002
    Location
    San Antonio, TX
    Posts
    69
    Try this:

    Dim tbl As TableDef
    Dim strTableToCheck As String

    For Each tbl In CurrentDb.TableDefs
    If tbl.Name = strTableToCheck Then
    MsgBox "Table Exists"
    End If
    Next tbl
    "Doing stuff is overrated. Take Hitler for example. He did lots but don't we all wish he'd have just stayed home and gotten stoned?"

  3. #3
    Join Date
    Oct 2002
    Location
    Inland Northwest(US)
    Posts
    19
    Thanks!!

  4. #4
    Join Date
    Dec 2002
    Location
    St. Cloud, MN
    Posts
    1

    Determining if table exists

    Thank you. I've been searching Microsoft Knowledge Base for this and their solution wasn't working. This was a piece of cake.

Posting Permissions

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