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 / February 2008

Tip: Looking for answers? Try searching our database.

subform not refreshing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mav51 - 10 Feb 2008 23:40 GMT
Hi there, I have a main form with a subform embedded to be able to scroll
through a list of records.  There is no linking field between the two.  The
subform displays all the records properly.  One of the fields in the subform
is a checkbox to 'close' the record indicating that the info is no longer
current and shouldn't be displayed.  This works fine.  I should also mention
that the subform is based on a query.
I have a button on the main form which opens another modal form based on the
same query as the subform that will let me uncheck the checkbox in case the
record was 'closed' by accident and is actually still current.  This works
also, when I check record A then close and reopen the main form record A is
gone.  If I open the modal form, uncheck the appropriate box, close and
reopen the main form, record A is back.
My question is "Is it possible to have the main form, and by extension, the
subform reload so that record A reappears without having to close and reopen
the main form?"
I've tried setting the focus to the form/subform and running the requery
method with no success.

Any help is appreciated, thanks!
Michael
boblarson - 11 Feb 2008 02:22 GMT
You can requery the subform by using this syntax-

If the code is on the main form:

Me.YourSubformContainerName.Form.Requery

If the code is on another form:

Forms!YourSubformContainerName.Form.Requery

Where YourSubformContainerName is the name of the container control that
houses the subform on the main form and not the subform name (unless it is
the exact same name as the container, which they can be the same but aren't
necessarily so).
Signature

Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________

> Hi there, I have a main form with a subform embedded to be able to scroll
> through a list of records.  There is no linking field between the two.  The
[quoted text clipped - 16 lines]
> Any help is appreciated, thanks!
> Michael
mav51 - 15 Feb 2008 20:36 GMT
That did the trick, thanks!

>You can requery the subform by using this syntax-
>
[quoted text clipped - 15 lines]
>> Any help is appreciated, thanks!
>> Michael
 
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.