Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Oct 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Link/Unlink Tables (2000)

    Upon opening a form I link to its backend table by using the "DoCmd.TransferDatabase aclink..." command. All works fine. I know I need to "unlink" the table when closing the form but cannot figure out the command. Without the unlinking portion, it creates multiple links (LinkTable1, LinkTable2 etc.). Two questions. What is the command to unlink the tables and will this work in a multiple user application.

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

    Re: Link/Unlink Tables (2000)

    Unlinking a table means deleting the table (since it is only a link, you won't delete the backend table, only the link in the frontend.) This can be done using

    DoCmd.DeleteObject acTable, "TableName"

    or by using the DAO instruction (you need a reference to the Microsoft DAO 3.6 Object Library for this):

    CurrentDb.TableDefs.Delete "TableName"

    If every user has his/her own copy of the front end, this should pose no problem, but if users share the frontend, this will lead to conflicts.

  3. #3
    Star Lounger
    Join Date
    Oct 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Link/Unlink Tables (2000)

    Thanks Hans...that worked great except for the tables that participate in a relationship. Is there a simple way to delete the relationship first then the table?

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

    Re: Link/Unlink Tables (2000)

    See <post#=267600>post 267600</post#> for code to delete all relationships and all tables from a database. It needs a reference to the Microsoft DAO 3.6 Object Library (in Tools | References...)

Posting Permissions

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