TransferDatabase

D

duffer 54

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
 
B

Brendan Reynolds

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
 
D

duffer 54

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?
 
B

Brendan Reynolds

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"
 

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