473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Attached Table Linking in VBA Code

344 Expert 100+
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
4 2753
JConsulting
603 Expert 512MB
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
Lysander
344 Expert 100+
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
603 Expert 512MB
Thats why groups like this exist. Thanks, exactly what I need.
anytime. happy to help!
J
Jun 2 '07 #4
JConsulting
603 Expert 512MB
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

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

Similar topics

1
by: mksql | last post by:
As an example, I am building an authentication mechanisim that will use data in the 3 left tables to determine rights to objects in a destination table, diagrammed below. In this structure,...
2
by: Wilder | last post by:
I'm trying to update a field in one table with the minimum values of the field in another table. The two tables are linked via a common field. I want to populate a date field in one table with...
4
by: sheree | last post by:
I have 3 tables (amoung a few others) in a small access database. The tables are as follows: == AEReport -------- AEID (PK) RptCatelog GCRCID PatientID EvntDate
3
by: Arno R | last post by:
Hi all, Starting from Access 2k we can use tables and queries directly in the Subform control as a SourceObject. The Subform-Sourceobject can be assigned when a query or table has been chosen from...
2
by: Vern | last post by:
I created a table in a dataset that contains multiple columns. I attached a combo box to that table. Now I'm doing something wrong with trying to retrieve the value of the third column of the...
7
by: Lisa | last post by:
I have an Access 2000 application that uses the following function to re-link my tables when I switch from my Current back end to a Dummy back end. I also use it to refresh my links. Function...
12
by: rdemyan via AccessMonster.com | last post by:
I'm having a complicated linking problem. Before I get into the particulars, I'd like to know how Access links to the back-end file at startup, AFTER I've distributed my application to the client....
5
by: Regnab | last post by:
I have a table "tblSprayApplication" in a project for a nursery. Each record refers to a single spray application across the nursery, recording which groups had been sprayed. Multiple applications...
2
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.