How do I set relationships in Access using VBA?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to re-set relationships between tables after importing. The import
function is currently done with a macro which works fine, but I'd like to set
the relationships between tables problematically rather than have the user do
it manually.
 
Dan Rolfe said:
I need to re-set relationships between tables after importing. The import
function is currently done with a macro which works fine, but I'd like to set
the relationships between tables problematically rather than have the user do
it manually.


Check Help for the CreateRelation method.

Or you could use an SQL DDL statement with a CONSTRAINT
clause.
 
On Fri, 24 Dec 2004 08:27:03 -0800, Dan Rolfe <Dan
I need to re-set relationships between tables after importing. The import
function is currently done with a macro which works fine, but I'd like to set
the relationships between tables problematically rather than have the user do
it manually.

There's an option on Import to import with relationships intact. I
don't use macros much so I'm not sure how to specify that in the
macro; but check out the documentation for TransferDatabase.

John W. Vinson[MVP]
 
Back
Top