I have a subform displayed in continuous forms that I need to refresh from
the parent form.
I can refresh controls on a subform as:
Me.f_Note_sub.Form![cboNationID].Requery
But when I try to refresh a subform recordsource as
Me.f_Person_sub.Form!RecordSource.Requery
I get an error that Access does not recognize "RecordSource"
Can anyone help me with the syntax to refresh a subform's recordsource?
Penguin - 11 Jan 2005 05:27 GMT
Try this code:
Dim MyControl As Control
Set MyControl = Forms!FormName!ControlName
MyControl.Requery
Replace FormName for your main form name and ControlName for the name
of the subform control on the main form.
Hope this helps.
>I have a subform displayed in continuous forms that I need to refresh from
>the parent form.
[quoted text clipped - 10 lines]
>
>Can anyone help me with the syntax to refresh a subform's recordsource?
Marshall Barton - 11 Jan 2005 05:36 GMT
>I have a subform displayed in continuous forms that I need to refresh from
>the parent form.
[quoted text clipped - 8 lines]
>
>I get an error that Access does not recognize "RecordSource"
The !RecordSource is inappropriate. Just use:
Me.f_Person_sub.Form.Requery

Signature
Marsh
MVP [MS Access]
Dave - 11 Jan 2005 07:12 GMT
Thanks guys
>>I have a subform displayed in continuous forms that I need to refresh from
>>the parent form.
[quoted text clipped - 12 lines]
>
> Me.f_Person_sub.Form.Requery