Copy external to local database -- Access 2000

  • Thread starter Thread starter L.A. Lawyer
  • Start date Start date
L

L.A. Lawyer

I want to copy objects (eg, forms, queries, modules, etc.) from an external
database (clients.mdb) to the current database: I do want the external
objects to replace the current database's objects of the same name and to do
this without user involvement.

How is that done?
 
AFAIK, you can't make Access replace the objects. You'll have to determine
the name of each object, delete it if it already exists, then import it.

You can use TransferDatabase to do the actual transfer, but you'll need to
use Automation to inspect the name of each object in the source database.
 
Ok, I will program it to delete the local objects, which is no big deal
since DoCmd.DeleteObject is pretty straightforward.

Now, how do I reference and copy the external objects to the active
database? I see that I can do DoCmd.CopyCbject, but I don't know how to
reference these named objects (queries, modules, forms, etc.) in that
command. For example, how would I reference a form called "People" in an
another mdb file named "All Clients"?
 
As I said before, use the TransferDatabase method:

DoCmd.TransferDatabase acImport, "Microsoft Access", _
"C:\DBS\All Clients.mdb", acForm, "People", _
"People"
 
Back
Top