code to unlink a table?

  • Thread starter Thread starter Judy Ward
  • Start date Start date
J

Judy Ward

I want to link to a table, run a query, and then unlink from the table.

I have the code working to link to the table:
DoCmd.TransferDatabase acLink, "Microsoft Access", _
"c:\data\db.mdb", acTable, "sourcetbl", "linktbl"

Does anyone know how I can unlink (in code, not by clicking)?

Thank you,
Judy
 
I want to link to a table, run a query, and then unlink from the table.

I have the code working to link to the table:
    DoCmd.TransferDatabase acLink, "Microsoft Access", _
        "c:\data\db.mdb", acTable, "sourcetbl", "linktbl"

Does anyone know how I can unlink (in code, not by clicking)?

Thank you,
Judy

delete the table. It's linked, so you're only deleting the link, no
actual data.
 
I want to link to a table, run a query, and then unlink from the table.

I have the code working to link to the table:
DoCmd.TransferDatabase acLink, "Microsoft Access", _
"c:\data\db.mdb", acTable, "sourcetbl", "linktbl"

Does anyone know how I can unlink (in code, not by clicking)?

Thank you,
Judy

delete the table. It's linked, so you're only deleting the link, no
actual data.

VBA code to do this is

DoCmd.DeleteObject acTable, "NameOfTable"
 
Back
Top