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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with key values on forms based on multiple tables

Status
Not open for further replies.

charle525

MIS
Jul 18, 2003
23
US
I have a bound form based on a query that selects from multiple tables (6-8). Many of the foreign key relationships are integer ID numbers. The user will enter all of their data, and I have set up the BeforeUpdate event to fill in the appropriate key values to complete the records. However, when trying to update, I am still getting errors that there is a null value in the primary key or that records are required in one of the multiple tables before I can create a record in another of the tables, for example: "You cannot enter a record in this table because a related record is required in tblProgramApplication." I can sort of see the problem, but not a solution. Is there anyway to maintain this bound form, or do I need to go to an unbound form that executes SQL updates?
 
Check the referential integrity rules in the relationships window. You will need to make sure you updates are done in the right order, or do not enforce referential integrity.
 
Thanks for the help. I would like to maintain referential integrity, so I need to make sure my updates are done in the right order. How can I control what order the updates work on a bound form?
 
Check the code behind you BeforeUpdate event. Make sure that the keys are posted in the right order. You may have to verify that all required fields on the form have been filled in first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top