How do I set relationships in Access using VBA?

D

Dan Rolfe

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.
 
M

Marshall Barton

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.
 
J

John Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top