dawn_g
12-06-2001, 07:02 AM
I would like to pass the field "unique_id" from form "addnewpeople" to the field "people_unique_id" of form "casesubform". I've tried lots of ideas posted earlier in this forum (such as OpenArgs, OnClick, OnEntry, etc.) but can't get anything to work. I'm wondering if this is because "casesubform" is a subform of "addnewcase" and I can't get the syntax right since previous posted examples only involved two forms.
Thanks for your help.
-Dawn
Jack Cowley
12-06-2001, 07:48 AM
If what you have is a One (main form) to Many (subform) relationship then this would be automatic. The foreign key in your subform should be named "unique_id" and should be a Data Type Long Integer. You should have a join in your Relationship window beween these two fields and the master/child links in your Form/Subform should be "unique_id". It it is setup this way then when entering data into the subform Access will automatically add the "unique_id" from you main form to the subform.... Hope I explained that well enough.
dawn_g
12-06-2001, 09:23 AM
Jack, thanks for your reply. Your explanation is very clear, but my original wasn't! I want to pass data from form A to the subform of form B.
Here is the scenario: the user enters a new person in form A. They click a button on form A to open form B to enter the case info. There is a subform on form B with a combo box that shows which people are associated with this case. I would like to have the person they just entered on Form A automatically show up as the default selection in Form B's subform combo box.
I hope I make sense.
-Dawn
Jerry Stoner
12-13-2001, 05:45 AM
I have exactly the same problem, can update the subform with an update query but only if referential integrety is turned off and I do not want to do this. Greatly interested in hearing an answer to this problem.