Microsoft KB Archive/93297

= ACC: How to Remove Linked ( Attached) Tables with a Macro =

Article ID: 93297

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q93297



Novice: Requires knowledge of the user interface on single-user computers.



SUMMARY
The TransferDatabase action is the macro equivalent of the Link Tables command (or Attach Table command in versions 1.x and 2.0). However, Microsoft Access does not have an action to delete a link to a linked (attached) table. To remove a linked table from the Database window, select the table in the Database window and press the DELETE key. You can also create a macro to delete a link to a linked table, or you can call the action from code by using the DoCmd statement or the RunMacro method.



MORE INFORMATION
To delete a link to a linked table in Microsoft Access version 2.0, 7.0, or 97, create the following macro and save it as RemoveTable:

  Macro Name    Action --  RemoveTable   DeleteObject

RemoveTable Actions ---  DeleteObject Object Type: Table Object Name:

In code, use a DoCmd statement or the RunMacro Method to run the RemoveTable macro as follows:

  DoCmd.RunMacro &quot;RemoveTable&quot; ' In Microsoft Access 7.0 and 97

DoCmd RunMacro &quot;RemoveTable&quot; ' In Microsoft Access version 2.0

To delete a link to a linked table in Microsoft Access version 1.x, create the following macro and save it as RemoveTable:

  Macro Name   Action -  RemoveTable  SelectObject DoMenuItem

RemoveTable Actions ---  SelectObject Object Type: Table Object Name: In Database Window: Yes DoMenuItem Menu Bar: Database Menu Name: Edit Command: Delete

Additional query words: unattach

Keywords: kbhowto kbinterop kbusage KB93297

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.