FK ID's not populating

F

flipper1067

I have a form that has a FK in it but it isn't populating. When I g
into frmApplication and click in children subform on the command butto
""Answer Child Questions". Then I Click on that and try to put in
response to the first question. It won't let you move on to the nex
question because there is no value for ChildID. I could type th
ChildID in, but of course, I want them to autopopulate instead. I trie
to put in the following in the default value for the ChildID text box i
frmChildQResponses
[Forms]![frmApplication]![sfmChildren].[Form].[ChildID]

Can anyone help me link these two forms or figure out what I am doin
wrong? Thanks
 
K

Ken Snell \(MVP\)

Check out the LinkMasterFields and LinkChildFields properties of the subform
control (the control that holds the subform object) on the main form. These
are used to synchronize the main form and subform in this way.
 
F

flipper1067

The main form is the questions and the subform is the answers. But
also need the subform to link to the Child from which has the ChildID.
The main form (questions) and the sub form (answers) are linked by th
question ID
 
K

Ken Snell \(MVP\)

I am sorry, but I do not understand? The subform needs to link to another
subform? Or you need two fields to be the links between the main form and
the subform?
 
F

flipper1067

The subform needed to be linked to its main form, which I did, and als
to another subform
 
R

Ron2006

You will have to write the code yourself to supply the childid in the
before insert event. This is because the subform is child to the prior
subform and that key will be supplied automatically, but the next
higher up form IS NOT supplied automatically.
 
Top