Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding related record through Form problem?

Status
Not open for further replies.

perrydaniel

Technical User
Apr 27, 2004
56
IE
Hi, would appreciate some help on this one, as it is driving me crazy...

I have 2 tables. One called Owner, the other property. They are related 1 to Many. i.e one owner can have many properties. I have a FK in the property table (OwnerID), now for the problem.

I can add a new owner and a new property via TABLES, by opening the Owner Table and putting their details in and then clicking + to open the linked Property table and adding the new details.

However when i try this in Forms, which I have Owner as my main form and Property as a sub form i get the error message 'Cannot add record as a related because a related record is required in table Owner'

Even though I have added the owner first and that OwnerID is generated! Please help, losing hair by the minute..

Perry
 
Hi
What are your link child fields and link master fields for the subform? I ask, because I have tried this and I get the above error if I do not have these properties set, but everything works fine if I do.
 
Remou

Link child and master are set to OwnerID on the Subform. I have an old copy of the database, and it works fine on that!! Access is crazy!

Thanks
 
What happens if you import the old copy into the new copy? Might help to sort out where the problem is occurring.
 
The problem has fixed itself. I closed down PC (restarted) and hey presto the thing works. Welcome to the mad world of Access databases.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top