Jun 25 2021 05:16 PM
I created a DB with two tables:
Property table
propID autonumber primary key
address short text
city short text
state short text
Residents table
resID autonumber primary key
propID large number
nameLast short text
nameFirst short text
I setup a one-many relationship between propID (Property table) and propID (Residents table).
BUT when I check the Referential Integrity checkbox in the dialog on the Relationships page, I get the following error "Relationship must be on the same number of fields with the same data type."
Both "propID" fields ARE the same data type.
How do you set up Referential Integrity (I never had this problem with earlier versions of Access)
Jun 25 2021 05:59 PM
Your post shows that the field called propID in the Residents table is a "large number". Large Number is a different data type from "Long Integer". The AutoNumber propID in the Property table is a Long Integer, not a Large Number. Change the datatype to Long Integer for that field in the Residents table.
Jun 25 2021 07:42 PM
@George_Hepworth Thanks. Yes, I know that the indexes are long integer but I haven't run into this "Large Number" so I took a guess---wrongly.
Thanks much.
Larry Woods
Jun 26 2021 06:29 AM
@lwoodsusa I'm glad you were able to sort it out.
The Large Number datatype was added for compatibility with SQL Server's BigInt datatype. If you have not worked with a SQL Server back end, though, it might not have been something you'd take note of.
Jun 26 2021 07:11 AM
Jun 26 2021 07:16 AM
Jun 26 2021 07:24 AM
Jun 26 2021 07:43 AM
Yes, SQL Server Express Download is free. SQL Server Management Studio is, IIRC, part of the package.
If you are more comfortable with MySQL, that is also a good option.