Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

How can I refresh a subform's recordsource?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 11 Jan 2005 02:55 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.