Re: Putting a field on a form from another record



yes, it does help, thanks. if you were building the database, my first
recommendation would be that you restructure the tables to include a table
listing each child (person, not table <g>), and use one or more child tables
of *that* table to record the various activities associated with a child
(person). but, given your situation, we'll forego addressing the root cause
of the problem, and see if we can get around it at the form level.

you can link the second child subform to the first, within the main form.
i've never tried exactly the following setup, but it might work for you:
make sure both subforms are linked to the parent form with the standard
primary key/foreign key field references in each subform control's
LinkChildFields and LinkMasterFields properties. then add an unbound textbox
control to the *main* form, set its' Visible property to False, set its'
ControlSource property to the name of the date of birth field (i'll call it
DOBa) in the first subform control (i'll call it ChildA), as
=[ChildA].[Form]![DOBa]
you'll need to substitute the correct names in your database, of course.
name the textbox control txtDOB.
in the second subform control, *add* the name of the date of birth field to
the LinkChildFields property. so that property will show two fieldnames:
the foreign key field that links the table to the parent table, and the date
of birth field.
still in the second subform control, *add* the name txtDOB to the
LinkMasterFields property. so that property will show two names: the
primary key field of the parent table, and the name of the unbound textbox
control on the parent form.

so (hopefully) when you choose a record on the parent form, the first
subform should display all the child records related to that parent record.
and the second subform should display the records related to that parent
record *where the date of birth matches the current record in the first
subform*.

hth


.



Relevant Pages

  • RE: IF...THEN statement on pop-up form: possible?
    ... If I enter the department name and then change it, the parent box ... Should the parent box have a bound control source? ... department name from the last record in the subform. ... Then compare the value from within the popup form. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Using macros to permit updating of subform
    ... i'll call this control: cboFindClient. ... should be ClientID. ... the recordin the Activities subform change to match the current ... because I am confused on the terms main and parent. ...
    (microsoft.public.access.macros)
  • RE: IF...THEN statement on pop-up form: possible?
    ... "scubadiver" wrote: ... If I enter the department name and then change it, the parent box ... How about putting the RecordSetClone code in the subform textbox's ... A ControlSource is used if you want to save the data in the control. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Cant figure out nested subform and requery syntax
    ... >another tab control. ... >it's detail section, one direct child, frmB. ... >the linking parent field on frmB. ... >beginning since frmA actually is a subform of frmMain ...
    (microsoft.public.access.formscoding)
  • Re: LinkMaster>LinkChild problem
    ... created in the child table, but its ID had not been inserted in the ... key value of the related parent record - but parent records do not ... In this case, the Parent/Child structure is reversed, because Subform 2 ... a foreign key field does NOT have to have the same name as its' ...
    (microsoft.public.access.forms)