DoCmd.TransferDatabase in VB Code

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I have code behind a button click that transfers a table
from a database on a floppy disk into the current database.

It reads
DoCmd.TransferDatabase acImport, "Microsoft
Access", "a:\Bakers.mdb", acTable, "bakers", "bakers",
False

I want the user to be able to specify a path to the
database rather than hard code to the floppy drive. The
database has been emailed for about 2 years and the user
has to copy it to a floppy to import it.

Thanks for any help.
Larry
 
Hi Larry,

Use the code at http://www.mvps.org/access/api/api0001.htm to display
the standard File Open dialog to get the filespec to substitute for the
hard coded one.

If the file is always going to be "Bakers.mdb" and you just want the
folder, see http://www.mvps.org/access/api/api0002.htm

I have code behind a button click that transfers a table
from a database on a floppy disk into the current database.

It reads
DoCmd.TransferDatabase acImport, "Microsoft
Access", "a:\Bakers.mdb", acTable, "bakers", "bakers",
False

I want the user to be able to specify a path to the
database rather than hard code to the floppy drive. The
database has been emailed for about 2 years and the user
has to copy it to a floppy to import it.

Thanks for any help.
Larry

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Thanks, I'll check that out.
Larry
-----Original Message-----
Hi Larry,

Use the code at
http://www.mvps.org/access/api/api0001.htm to display
the standard File Open dialog to get the filespec to substitute for the
hard coded one.

If the file is always going to be "Bakers.mdb" and you just want the
folder, see http://www.mvps.org/access/api/api0002.htm

I have code behind a button click that transfers a table
from a database on a floppy disk into the current database.

It reads
DoCmd.TransferDatabase acImport, "Microsoft
Access", "a:\Bakers.mdb", acTable, "bakers", "bakers",
False

I want the user to be able to specify a path to the
database rather than hard code to the floppy drive. The
database has been emailed for about 2 years and the user
has to copy it to a floppy to import it.

Thanks for any help.
Larry

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
I have a quick question on this. How would you do the file dialog in
conjunction with the Do.Cmd Function?

Thanks,

Dan
 
Back
Top