I'm trying to link the "Subject" table to the "StudentSubject" table in the image below, but I get the error "Invalid field definition 'SubjectID' in definition of index or relationship." when I attempt to do so. The end-goal is that I want to create a many-to-many relationship between Student and Subject, such that a student can take many subjects, and a subject can be taken by many students. I'm sure this is a basic error, but I haven't found a general solution to this problem, and I'm rusty on Access.

[![enter image description here](https://i.stack.imgur.com/qCZRs.png)](https://i.stack.imgur.com/qCZRs.png)

I drag the "SubjectID" from the Subject table over to the SubjectID from the StudentSubject table, and try to create a relationship, checking both boxes for enforcing referential integrity. It returns the error.

Here are the properties for the Subject table:

[![enter image description here](https://i.stack.imgur.com/RpgR9.png)](https://i.stack.imgur.com/RpgR9.png)

And here are the properties for the StudentSubject table:

[![enter image description here](https://i.stack.imgur.com/lQop9.png)](https://i.stack.imgur.com/lQop9.png)

The properties are the same, so I'm not sure why it doesn't work. It works if I don't enable Referential Integrity, but then it's a one-to-one relationship, and I thought it should be a one-to-many, as there should be multiple students taking the same subject.

Would appreciate any advice on this error, thanks.