I have written some VBA to create a basic data model in Excel from an Access database. It’s nearly there, but I have found an issue with finding the Foreign keys in tables.
Here is the relationship:
And here are the indexes in table tblSubHeading:
When I use the Relation object the VBA successfully comes up with the ForeignTable and Foreign field names. However, when I loop through the indexes for the ForeignTable and check the Foreign property none are selected. Here's the code:
It finds nothing. Can anyone explain why this should be.
Thanks for your help
Bodders
Here is the relationship:
And here are the indexes in table tblSubHeading:
When I use the Relation object the VBA successfully comes up with the ForeignTable and Foreign field names. However, when I loop through the indexes for the ForeignTable and check the Foreign property none are selected. Here's the code:
Code:
For Each idx In tdf.Indexes
If idx.Foreign = True Then
For Each fld In idx.Fields
astrFK(intFKCount) = fld.ForeignName
intFKCount = intFKCount + 1
Next
End If
Next
It finds nothing. Can anyone explain why this should be.
Thanks for your help
Bodders