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

Can't add records because of Join Key

Status
Not open for further replies.

Garridon

Programmer
Mar 2, 2000
718
0
0
US
I created a query for a form using the query wizard.&nbsp;&nbsp;It uses three tables, and there isn't any criteria.&nbsp;&nbsp;When I look at the query, I can see all the records.<br><br>Then I used the query to create a form, also using the wizard.&nbsp;&nbsp;When I open it, it goes right to the first record.&nbsp;&nbsp;But when I try to add in a record for the fields from one specific table, tells me &quot;Cannot add records: Join Key of tblMyTable1 not in recordset.&quot;&nbsp;&nbsp;I can input on fields from tblMyTable2 and tblMyTable3 without any problems.<br><br>I tried deleting the form and query and starting again--with the same result.&nbsp;&nbsp;I have gone in checked out the other forms, and there isn't any problems.&nbsp;&nbsp;Any thoughts?<br> <p>Linda Adams<br><a href=mailto:Garridon@aol.com>Garridon@aol.com</a><br><a href= Adams Online</a><br>I'm a professional writer, published internationally.
 
Whatever field in tblMyTable1 is the join field to the other tables must be available to the form, so add it to the query on which the form is based.<br><br>That should do it.<br> <p>Kathryn<br><a href=mailto: > </a><br><a href= > </a><br>
 
Typically, in a normalized database you wouldn't be updating data in three tables using a join. Most times a child table will be linked as a subform to the parent table which is the source for the main form. If there are 2 child tables then 2 sub forms. This is the way Access is designed to work and is a safe programming practice.
 
Only one actual table is being updated from this form, the one I'm having join problems with.&nbsp;&nbsp;The other two tables are used for information that is repeated over and over, like the status (inactive/active) and the state.<br><br> <p>Linda Adams<br><a href=mailto:Garridon@aol.com>Garridon@aol.com</a><br><a href= Adams Online</a><br>I'm a professional writer, published internationally.
 
When you use a join, Access isn't going to know that YOU only want to update one table. It is best to put the repeating information on a main form and the records you want to update on a sub form. Do a query for the main form with the repeating data and then LINK the sub form through the foreign key (a key from the repeating data) to the main form. If your database is not set up to do this then you may want to review the design, if possible, since a properly normalized database will save you problems in the future. The processing in Access is designed to work well with normalized data.&nbsp;&nbsp;<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top