468,253 Members | 1,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,253 developers. It's quick & easy.

Problem with correct loading of tab control bound to 1-to-1 related table

49
Working in Access 2003 with Access 2000 file format.

I'm trying to set up a form with a six-page tab control, three pages of which contain subforms bound to a table that has a 1-to-1 relationship with the parent form's bound table. I've proceeded to relate the tables in this way (which makes the most sense to me for the situation), encouraged by the thread below:

Limit subform to 1 entry

Now, this arrangement generally works all right, but if I come to a record that does not yet have a corresponding record in the related table, and start entering data for it, I run into problems when I go to one of the other pages of the tab control. Trying to enter more data (which ought to go into the same new related record) gives me the 'The changes you requested... would create duplicate values' error.

I gather Access is somehow trying to make a second related record, which it can't because the primary key is equal to the main record's primary key.

No problems occur once the related record has been saved (i.e., I have to start entering some data, move to a different main record and then come back); the code provided by ADezii in the other thread makes sure that the existing related record gets loaded up, for any of the tab control pages.

Another possible symptom is that sometimes I get an error like 'The record contains no data'--a dialog box that pops up three times in a row when closing the main form. I can't recreate it at the moment, and I've never known exactly what conditions cause it, but I'll be watching out.

Is there any way to force the other two pages to go to the newly created record in the related table?
Nov 9 '10 #1
0 1000

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Vannela | last post: by
reply views Thread by | last post: by
reply views Thread by Vannela | last post: by
1 post views Thread by Josť Joye | last post: by
2 posts views Thread by dorrit.Riemenschneider | last post: by
1 post views Thread by shyam | last post: by
3 posts views Thread by DoB | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.