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!

What can cause this error message!?

Status
Not open for further replies.

nonturbo

IS-IT--Management
Aug 27, 2001
78
US
Upon opening a form (with some heavy VBA) I get a dialog that says: "You cannot add or change a record because a related record is required in table 'TableName'." The table-data is all fine though, and I *CAN* add or change records in the form. This started happening when I cleaned out the backend to start the system with some fresh data. But out of curiosity, has anyone experienced this before? Any ideas on what to check for? Please help! TIA..
 
Hi nonturbo,

Firstly I would suggest a repair and compact.

Secondly I would examine the tables/queries that the form is running on. If you are running a form based on a query or table, try adding data directly to the table or query to see if the same message arises - this might isolate the problem to table relationships or queries.

Thirdly, (NB - save a back up of your form before doing this) if the message only arises in the form, I would suggest removing the link in the form to its underlying recordset, closing and saving the form, and then reopening without a recordset to see if this gives the message. Then put the recordset back, close and save and reopen again. Another area to check is the code (if any) on the OnOpen, On Load or OnCurrent properties of the form - try remming out the code and reopening.

Hopefully this will help to isolate the source of the message.

Finally, I have noticed in Access97 (& 2000) that if you have an unusual error, breaking something, saving it, and then rebuilding just the same can sometimes sort out the problem. Hope this helps, jobo123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top