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

Attached Table Linking in VBA Code

Expert 100+
P: 344
I have two databases, one a research system, one a clinical system. Never the two shall meet, except once. As soon as the baseline surveys have been completed in the research system, I need the clinical system to link to the research tables, extract all the name and id data and then drop the links.

What I can't work out how to do is create the link in code. I need something like

set db=currentdb
db.AttachNewTable ("mytablename","Z:\bissau\researchdata.mdb)

and similar code to drop the link when I've grabed the data.

TIA
Jun 2 '07 #1
Share this Question
Share on Google+
4 Replies


JConsulting
Expert 100+
P: 603
I have two databases, one a research system, one a clinical system. Never the two shall meet, except once. As soon as the baseline surveys have been completed in the research system, I need the clinical system to link to the research tables, extract all the name and id data and then drop the links.

What I can't work out how to do is create the link in code. I need something like

set db=currentdb
db.AttachNewTable ("mytablename","Z:\bissau\researchdata.mdb)

and similar code to drop the link when I've grabed the data.

TIA

use the transferdatabase command

DoCmd.transferdatabase acLink, "Microsoft Access","Z:\bissau\researchdata.mdb, acTable, "mytablename","mytablename", False

J
Jun 2 '07 #2

Expert 100+
P: 344
use the transferdatabase command

DoCmd.transferdatabase acLink, "Microsoft Access","Z:\bissau\researchdata.mdb, acTable, "mytablename","mytablename", False

J
Thats why groups like this exist. Thanks, exactly what I need.
Jun 2 '07 #3

JConsulting
Expert 100+
P: 603
Thats why groups like this exist. Thanks, exactly what I need.
anytime. happy to help!
J
Jun 2 '07 #4

JConsulting
Expert 100+
P: 603
Thats why groups like this exist. Thanks, exactly what I need.

forgot this part

to delete using code

on error resume next
currentdbdb.TableDefs.Delete "tablename"

J
Jun 2 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.