Thread: Data Types and Junction Table
03-26-15, 10:52 #1Registered User
- Join Date
- Oct 2010
Unanswered: Data Types and Junction Table
I'm having trouble creating relationships between a junction table and two regular tables, because the primary keys are set as autonumbers and my other fields are short or long text. I keep getting the error message that "relationships must be on the same number of fields with same data types." I thought a PK set to autonumber could form a relationship with a text field? What other way is there to form this relationship?
03-26-15, 11:50 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
a FK MUST always be of the same datatype (and if relevant the same size) as the PK column it refers. when you define an autonumber column in Access it implements that as a long integer, so you must use the long integer as the datatype in the table that holds the FK.
a FK must have one row in the referenced (parent) table (the PK) and can have none, one or more columns with that same FK in the referring (child) tableI'd rather be riding on the Tiger 800 or the Norton