auto fill foreign key in subform

  • Thread starter Thread starter desertdirk
  • Start date Start date
D

desertdirk

is there a way to have the foreign key in a subform take on the value of
the current primary key in the main form automatically? I know this can
be set using a combo box but I want it automatic
Thanks
 
The usual way to set up a subform is to set the Link Master/Child Fields
parameters of the subform control.

Set LinkMasterFields to the name of a *control* on the main form which
contains the primary key (the ONE side of the relationship).

Set LinkChildFields to the name of the *field* in the subform's recordsource
which contains the foreign key (the MANY side). It does not need to be
bound to a control on the subform

Then, when you add a new record to the subform, the foreign key field will
be filled automatically from the control on the main form.
 
Many thanks. I didn't recieve an email telling me anybody had replied to
this message. I will have to check my profile options. Anyway thanky
out. I had set up subform and form but forgot the parent child fields
 
Back
Top