Results 1 to 4 of 4
  1. #1
    JosmithTwo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    19

    Exclamation tableDefs displaying Tables not there

    I have been working on an Access 2007 database and have copied and recopied it as I make changes to the forms.

    I have this code to display tables in my database
    ---------------------------------------
    Code:
    Private Sub CMD_get_GDM_Click()
        List2.Visible = True
        List2.RowSource = ""
        
        Set db = CurrentDb()
        DoCmd.SetWarnings False
        For Each tbl In db.TableDefs
            If Left$(tbl.Name, 3) = "dbo" Then
                List2.RowSource = tbl.Name & "; " & List2.RowSource
            End If
        Next
    End Sub
    I have deleted all tables from my database and then send it off to the user. He links via ODBC to his source tables and runs this code.

    HOWEVER the tables listed for him are NOT his linked tables but the ones I deleted.

    I've passed this database to another PC and done the same process and my test works just fine, displaying the proper current tables.


    (Note: the "dbo" table name does not appear to be a problem)
    Help

    Jim

  2. #2
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    Quote Originally Posted by JosmithTwo View Post
    HOWEVER the tables listed for him are NOT his linked tables but the ones I deleted.
    try refreshing the links, as well as the table defs themselves:

    Code:
    database.tabledefs.refresh
    I can't remember what the syntax is for refreshing ODBC tbl def links, but google it. google something like "ms access vba refresh tabledef links"

    he will have to do it on his end. I don't think the links update themselves. I believe the syntax for that is ADO.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Television's 'Ghost Hunters' has nothing on MS Access! Reports of ghost Fields, Controls, Forms and Tables abound!

    After you've completed deleting these Tables, create a new, blank database and Import everything into it; I suspect that this will resolve the problem.

    Linq ;0)>

  4. #4
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    Quote Originally Posted by Missinglinq View Post
    create a new, blank database and Import everything into it
    that will *always* solve the issue! Why go the easy route and give him the answer right away, Linq!?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Working with TableDefs
    By farssr in forum Programming
    Replies: 2
    Last Post: 03-14-2011, 07:17 PM
  2. TableDefs.Delete
    By DaveE in forum Programming
    Replies: 3
    Last Post: 10-31-2010, 07:19 PM
  3. Displaying data from 2 tables in one
    By kbremner in forum Forms
    Replies: 6
    Last Post: 10-28-2010, 10:02 AM
  4. Displaying All Tables in Report
    By vCallNSPF in forum Reports
    Replies: 4
    Last Post: 12-07-2009, 03:45 PM
  5. Replies: 0
    Last Post: 06-17-2009, 09:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums