Refresh subform based on selected record

  • Thread starter Thread starter Eric Blitzer
  • Start date Start date
E

Eric Blitzer

I have a form with 2 subforms. One on the left and and one
on the right. The one on the left is a datasheet. When I
click on a record on the form on the left I want the form
on the right to show the detail records based on the record
selected selected. If I click another record on the form
on the left I want to refesh the form on the right
reflecting the new records. Also should I link this second
subform to the main form or the link to the subform on the
left is enough?

Thanks


Eric
 
Hello Eric,

I read your post that you wish to synchronize the records in the right
subform to the selected record on the left.

You need to know what the linking field is. On the main form place an
unbound texbox (make it invisble if you like) to act as the MasterLink
field. For example if the field which relates the left subform with the
right subform is called myID then call the unbound textbox, myID.

On the right subform set the LinkMasterFields and LinkChildFields properties
to myID.

Open the left subform up in design view. On the current event of the subform
enter a line:

Parent.[myID] = [myID]

There are other techiques for accomplishing this, but I have found the above
method to be the best and with no problems.

God Bless,

Mark A. Sam
 
Back
Top