code to unlink a table?

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
 
P

pietlinden

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.
 
K

Ken Snell \(MVP\)

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top