By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,839 Members | 2,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,839 IT Pros & Developers. It's quick & easy.

Transferdatabase

P: n/a
In copying tables i use the command Transferdatabase shown below.It is
a good command, but i need the following refinement.
I want to copy the table only when the Yes/No field "accepted" in the
table Unis is set to Yes.Can i do it in the command, and if not,
how can i set the condition ?
DoCmd.TransferDatabase TransferType, "Microsoft Access", appath,
acTable, "Unis", "Unis"

Dec 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I am not sure I understand what you want to do. If all you want to do
is copy the Table if come condition exists then check the condition and
make your copy decision based on that.

But I'm guessing you want to copy only certain records of the table.
The problem here is that, TTBOMK, TransferDatabase will not accept an
SQL string as the import Table parameter.

If I am right so far:

You could create and save a Query that selects the records you want and
you could use the name of that Query as that of the input Table.

or you use SQL

examples.

Sub ExportA()
DBEngine(0)(0).Execute "SELECT * INTO [C:\Documents and
Settings\Lyle Fairfield\My Documents\Access\downloads.mdb].[FirstTable]
FROM FirstTable WHERE Delivery = 103"
End Sub

Sub ImportA()
DBEngine(0)(0).Execute "SELECT * INTO ThirdTable FROM [C:\Documents
and Settings\Lyle Fairfield\My
Documents\Access\downloads.mdb].[FirstTable] WHERE Delivery = 103"
End Sub

IMO SQL is more powerful and less restricting than the Access method. I
recommend it.

Dec 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.