subforms help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform embedded into a form. These forms are linked on 5 child
fields. When I update these fields on the parent form, the subform does not
show the data that I need.

If I open the subform seperately (as a form all in itself) the data shows up
fine. So I guess the problem is that it is not refreshing once I change the
data in the parent form. I have tried to reference the subform in code and
use the refresh and/or requery commands but Access says that it cannot find
the form. Any help would be greatly appreciated.

Thanks,
Chad
 
Hi Chad,

You're wanting to write your code in the parent, as the subform may not even
exist yet. You might consider a Refresh Page on AfterUpdate when updating
parent fields. Considering you have multiple fields, you may wish to write a
function & call where needed.

Here is an event procedure for you, where FIELD is your field.

Private Sub FIELD_AfterUpdate()
DoCmd.RunCommand acCmdRefreshPage

End Sub

hth

Judi B
 
Back
Top