I was discussing this in another thread but it was way off topic so I'm reposting it here.
Short version: I need to know how to setup a Self Join for a table with a many-to-many relationship to itself.
Long Version: I have a table of Objects (i.e. Desktop Computers, Access Points, Offices, Personnel). Many of these Objects have other Objects as properties (Users belong to an Office, Desktop Computers belongs to a User, etc.). So, because of things like Users being able to belong to multiple Offices, but also, of course, multiple Users being able to belong to one Office, it needs to be a many-to-many relationships. There's also an ObjectType table and each Object Type can be assigned and ObjectType as a property as well. I'd like for my final forms to be datasheet forms. Each datasheet represents all the Objects in one ObjectType and each column is an ObjectType associated as a property to the datasheet's ObjectType. Here's my current structure:
tblJunctionObjectTypes
-JunctionID pk
-ObjectTypeID fk (The ObjectType receiving another ObjectType as a property)
-PropertyObjectClassID fk (The ObjectType being assigned as property.)
tblObjectTypes
-ObjectTypeID pk
-ObjectCTypeName
tblObjects
-ObjectID pk
-ObjectTypeID fk
tblPropertyObjects
-PropertyID pk
-ObjectID fk (The Object receiving an Object as a property)
-AttributeObjectID fk (The Object being assigned as a property)
How do I setup the relationships and how do I build a query that gets all Objects of a particular ObjectType and all the Objects of ObjectTypes associated <i>to</i> it.