TransferDatabase

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use the TransferDatabse command and get a popu window to
select the databse you want rather than specify the databse.

Thanks,

duffer54
 
Here's a quick-and-dirty example using InputBox to prompt for the target
database. You could get more sophisticated and user-friendly by using the
code at the URL below to open a dialog box to allow the user to browse for
the file.

DoCmd.TransferDatabase acExport, "Microsoft Access", InputBox("Database
Name?"), acTable, "tblTest", "tblTest"

http://www.mvps.org/access/api/api0001.htm
 
Thanks for your help Brendan, I got the first to work for me, and I looked at
the code on the site, how would I incorporate this into the TransferDatabase
command where it opens this box?
 
The code returns the name of the file that the user selected, so you would
use it in place of the call to the InputBox function. On the web page, just
before the start of the code, there is an example showing how to assign the
name of the selected file to a string variable named 'strSaveFileName'.
Following that example, the call to TransferDatabase might look something
like this ...

DoCmd.TransferDatabase acExport, "Microsoft Access", strSaveFileName,
acTable, "tblTest", "tblTest"
 
Back
Top