accmdcreaterelationship

H

Harry

Hi to all, I am wondering if it is possible to use VBA to create relationship? Example if possible.

Thanks in advance.
 
T

Tim Ferguson

Hi to all, I am wondering if it is possible to use VBA to create
relationship? Example if possible.

strSQL = "ALTER TABLE MyTable " & vbCrLf & _
"ADD CONSTRAINT MyFK FOREIGN KEY MyField " & vbCrLf & _
" REFERENCES MyOtherTable(MyOtherField);"

db.Execute strSQL, dbFailOnError

Of course, there is always the long way round. Check the help files for the
Relationships collection for further information.

HTH


Tim F
 

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