Kyle Finn
Kyle Finn

Reputation: 29

MS Access subform giving error "you cannot add a record because a record is required in table X

I have a form with a subform which I am trying to enter data into 2 tables: tblAnaesthesia and tblSamplesTissue. I have the autonumber primary key (called ProcRef) from tblAnaesthesia table which I am trying to add to the tblSamplesTissue table to a column called ProcRef using the subform. I set the master-child relationship in the form, and have two other master-child relationships between the subforms (animal ID and the date). There is a one-to-many relationship between the two forms in the Relationships view, with referential integrity checked. After entering the data into my main form I can see the row of data appear in the table tblAnaesthesia including the ProcRef. But once I try and enter data into the subform linked to tblSamplesTissue it tells me I can't add a record because a related record is required in tblAnaesthesia. But it is there!

What is wrong?

Upvotes: 0

Views: 36

Answers (0)

Related Questions