Creating Relations to linked Tables Via VBA

  • Thread starter Thread starter Gerry
  • Start date Start date
G

Gerry

I've been using the help file example to try and create a
new relation. but I keep getting an error on the append
that says I can't perform this on Linked tables.
Is there any way to create a relation for linked tables using VBA
If i Can then my next question is can I create
a relation from a local table to a linked table using VBA
I Am using Access2000
Thanks
 
I've been using the help file example to try and create a
new relation. but I keep getting an error on the append
that says I can't perform this on Linked tables.
Is there any way to create a relation for linked tables using VBA
If i Can then my next question is can I create
a relation from a local table to a linked table using VBA

You cannot enforce relational integrity across two databases; if you
create a rule in A.MDB there is no way that rule can be enforced if
someone opens X.MDB directly, or by linking to it from B.MDB.
Relationships must be defined in the database which contains the
tables, and only in that database.

You can use the OpenDatabase method to open the backend directly
(rather than using CurrentDb) and use DAO expressions on that database
object.

John W. Vinson[MVP]
 
Hi John,

Can you give me some direction about how I might use a DAO to "uncheck" the
"Enforce Referential Integrity" box between tables in a remote database using
the OpenDatabase method?

Thanks... Rod
 
Back
Top