Refreshing Sub-Form?

  • Thread starter Thread starter kim
  • Start date Start date
K

kim

i have a form with a subform - linked via a client ID
field. the idea is when i select a particular client ID in
the main form, the address of that particular client be
shown in the subform.

my problem is that the correct address is not showing up
until i move to the next record then come back to the
record i was updating. also, if i close the form, and
reopen it, the correct address is showing.

looks like i have to refresh the subform as soon as i
update the client ID field in the main form. how can i do
this? or is there other reason that i'm missing? or better
way of handling this situation?

thanks in advance.

kim.
 
i have a form with a subform - linked via a client ID
field. the idea is when i select a particular client ID in
the main form, the address of that particular client be
shown in the subform.

my problem is that the correct address is not showing up
until i move to the next record then come back to the
record i was updating. also, if i close the form, and
reopen it, the correct address is showing.

looks like i have to refresh the subform as soon as i
update the client ID field in the main form. how can i do
this? or is there other reason that i'm missing? or better
way of handling this situation?

You can requery the subform after making your selection by using code similar to
the following in the selection control's "AfterUpdate" event procedure:

'***
Me.SubformControlName.Form.Requery
'***

Replace "SubformControlName" with the name of the subform *control* on the main
form (not the name of the subform, although both may share the same name).
 
Back
Top