SubForm open SubSubForm (as popup) to add data - not working (1 Viewer)

hbrehmer

Member
Local time
Today, 02:23
Joined
Jan 10, 2020
Messages
78
Hi All,
I am working on a form, which allows a user to enter data in a continuous form (will call form A), but has a button to open a popup (form B) to add multiple assignments to the line of data they just entered. The form A data is the One of the one-to-many on my B form. So I should be able to add this data. When I had form B as a subform on form A, the data entry worked fine. But I want to clean up the entry screens and have the use just click a button to have a popup form to add the associating data to the line.

I can get the form to open, and enter the lines of data, but then when I go to save and close form B, I get an error saying "cannot add or change a record because a related record is required in table "[used on form A]". What is going on? I'm confused on how to fix this error. Do I need to have code that copies my key fields from form A to form B? How would I do that? I think my brain is melting with all this programming. :)

Thank you for the help!

Heidi
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:23
Joined
Sep 21, 2011
Messages
14,238
Sounds like you need the parent key in table A ?
 

hbrehmer

Member
Local time
Today, 02:23
Joined
Jan 10, 2020
Messages
78
Sounds like you need the parent key in table A ?

I actually do. The Parent Key in table A is referenced in table B. Table B is the many side of the relationship. So this should work.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:23
Joined
Sep 21, 2011
Messages
14,238
Are you passing the key as you open the form though?
 

Users who are viewing this thread

Top Bottom