I have a very simple database. I’m trying to link 2 tables together so that when I am looking at the MainList table, I can select the Category from the table CategoryList. Very, very simple.
I am trying to link the “category” column of my main table with the “category1” column of my category table. I have an extensive MS Access background, and I cannot figure this out to save my life. No matter what I do, I get the error:
SQL Status: S0011
Error code: -170
Primary or unique constraint required on main table: “MainList” in statement [ALTER TABLE “CategoryList” ADD FOREIGN KEY (“Category1”) REFERENCES “MainList” (“Category”)]
I have searched Google, this forum, and the help guides. While some posts here are related, I am totally lost reading the answers. Just tell me what I have to do. I don’t need a programmer’s explanation of the error.
Both tables have Primary Keys defined as Integers. They all have unique names. The big Base Guide says that the Foreign Key will be created in the linked table when I join the two column names together. It does not. I only get the error.
Do I have to create the Foreign Key myself in the CategoryList table?
I created this database by importing a spreadsheet into my MainList table, so the “Category” column of my main table is filled out already. All values exist in the CategoryList table. I wouldn’t get this error for a mismatch, though. I manually entered the values in Category List.
I am using LibreOffice 26.8.03 on Windows 11.
Thank you…
WeebleSue






