1
votes

I am making simple MS Access db with 4 tables and forms but when i make query from two tables i cant add new records in this query. I have created relationships and i made all fields type from relationships same format. I dont understand where the problem is. Is there anything that i dont understand or ?

Here are pictures from my relationships and tables

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

I need to make form from order table and in this form when i select in combobox companyCode i will that in other field automatically companyName fils, but it comes not...

1

1 Answers

4
votes

Your 1:n relations need to start from the Primary Keys of the tables, not some "code" column.

E.g. in order you should have a (Long Integer) column companyID instead of companyCode, and define the relation from company.ID to order.companyID.

Then a query that joins company and order will be editable.

On a different note: do all your orders contain just one single product? Usually there is a junction table between orders and order items to create a n:m relation.