I still having a little trouble working with relationships and Access. Thanks
for the help last week. I got one application completed and delivered.
I am now having a problem with another application that works similar to
my previous except that I have a dual-relationship.

I need to find out how to set a dual relationship (not sure if that is the
correct technical term). I have 2 tables that I need to make a relationship
between and I am not having any luck. The first table has two keys and then
second table has matching field with identical field names.


Table 1 Table2

Form_Number Form_Number
Form_Version Form_Version

Both the form_number and form_version make up the key and both the form_number
and version can be duplicated. However, both the form_number alopng with
it's version can not be dulicated. This is necessary because we are mirroring
a Oracle database that uses these dual keys.

What I need to know is how to set up this "dual" relationship via code. The
following is what I'm using to set a a single relationship.

Set relnew = .CreateRelation("NewFormLocation", "form_data_mgt", "form_location",
dbRelationDeleteCascade Or dbRelationUpdateCascade)

relnew.Fields.Append relnew.CreateField("form_number")
relnew.Fields!form_number.ForeignName = "form_number"
dbsSLL.Relations.Append relnew

I've tried adding another field and a foreign name and I've tried adding
a relationship and then creating another relationship adding the fields and
foreign name and then appending again.

I am getting an error because I do not have a unique index for the key.
I do not have a unique index because it's a dual index.

I am able to create the relationship via Access's relationship window, but
I can not do it via code.

Any ideas what I'm doing wrong and how I should correctly go about this?

Thanks for your time and help,

Greg Rothlander