Subforms master/Child link (1 Viewer)

Scolton

Registered User.
Local time
Today, 06:51
Joined
Mar 27, 2015
Messages
12
Hello,

i am building a user creation form.
I have built it with 3 subforms
Subform 1 is voor general information about the user.
Subform 2 is some more specific information about the user
Subform 3 is more info about the same user.

Now when i create a user (record) in subform 1 it gets the primary key lets say 14. Then when i add information in subform 2 i want it to grab the Primary key 14 from subform 1. so that the information which is inputed in subform 2 wil be related to information from subform 1. i hope i am making sense. but how do i create this. i get it working if i make a Main form and then put subform 2 and 3 in a subform and then let them grab the primary key from the main form. but how does this work with 3 subforms and no mainform.

thanks in advance.
 

plog

Banishment Pending
Local time
Today, 08:51
Joined
May 11, 2011
Messages
11,611
Like most things, there's a (hack) way to do it, however I really question your table set up. Your issue really sounds like a table issue, not a form issue. If the data in subform2 is related to subform1, then it should either be in the same table or subform2 should be a subform of subform1.

I think you should put forms aside for a moment and describe your data better. What table feeds each subform and how are those tables related?
 

Scolton

Registered User.
Local time
Today, 06:51
Joined
Mar 27, 2015
Messages
12
oke i have a table which is linked to Subform1 in the table i have general info like name telephone number email etc etc and then in my second table for subform 2 i have the other info like courses that person follows.
In the attachement you can find screenshots from my tables and relations.
I blacked out the records for privacy issues.
 

Attachments

  • docentinfo.png
    docentinfo.png
    17.4 KB · Views: 110
  • Inhoud.png
    Inhoud.png
    18 KB · Views: 94
  • Relaties.png
    Relaties.png
    16.8 KB · Views: 104

plog

Banishment Pending
Local time
Today, 08:51
Joined
May 11, 2011
Messages
11,611
Subform1 in the table i have general info like name telephone number email etc etc and then in my second table for subform 2 i have the other info like courses that person follows.

With that structure, subform1 shouldn't be a subform, but a main form. Then on it, you should have subform2. When you have a 1-many relationship between tables, the 1 becomes the main form and the many becomes the subform.
 

Users who are viewing this thread

Top Bottom