A family of Microsoft relational database management systems designed for ease of use.
Albert,
Again, I have NO idea of what you are saying.
I hope some else will help.
Ed
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I use Navigation forms A and B, each with several sub-forms. When making a change in NavigationA –subForm2
that will affect NavigationB –subForm1, how do I Requery/Refresh that subForm1?
for layout see:http://rpmw.com/Presentation_Files/index.html
I tried placing an If... statement on NavigationB that would close it and reopen it. It seems that once the Navigation form is opened it does not look at "On focus" or any other event.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Albert,
Again, I have NO idea of what you are saying.
I hope some else will help.
Ed
Albert,
Thanks for keep on trying.
I never know which subForm on the other navigation form is opened.
I tried the DoCmd.BrowseTo method but encountered an error ("Not in correct format...") using the code below. I used the IDENTICAL code on another form and IT WORKED!.
My CODE: DoCmd.BrowseTo acBrowseToForm, "Payee Form", "Start-up.NavigationSubform"
I looked at the MS recommended code below --> NO HELP
MS code: DoCmd.BrowseTo ObjectType:=acBrowseToForm, _ObjectName:="EventDS", PathToSubformControl:="Main.NavigationSubform"
Ed
The main issue here we have to be clear on is to distinguish between a tab control and that of the 2010 navigation form.
The other issue you not resolved is in what form (form what code location and what form) do you want to fire the re-query of the sub form?
If both forms sets are open (and you seem to suggest as such), then in the A-subform2, then
Something like this:
Me.parent.form.parent.form.formnavB.form.subform1.requery
So you can write some syntax in the A-subform2 that will re-query the b-subform1.
The other way to do this is to consider using the browseto command, but I think in this case it likely not required.
So you can "reference" the other form, but the reference syntax can be challenging.
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
Albert,
You sound very knowlegeable but i am having trouble following your advice.
The link should tell you what I am using - if not please download the software - Free 30 day trial (www.rpmw.com)
I can tell you this much the only way that I have found to requery the various forms of a Navigation Tab is to Close the Navigation form and then re-open it.
Thanks
Ed
Like I said, are the tabs or forms that don't requery behind an Access navigation form, or are they behind a tab?
The code I pointed out will work fine, it issue is without specific details why your car will not start (no battery or no gas) is much mean we are throwing darts with a blind fold here.
If the form in question is behind another navigation tab, then the form is NOT loaded at that point in time and you cannot reference such a form to requery it. And it rather hard just looking at a screen shot if the tab is in fact a tab control or as noted a navigation form (they look very similar – hard to tell apart in a screen shot).
As noted, the way to re-query a sub form is to simply use INSIDE of that given form this VBA syntax:
Me.MySubFormControlName.Requery
Note that the above WILL work if the parent form is dropped into a navigation form set. (but again as noted, we on a wild goose chase if you cannot clear up if we are talking bout tabs on a navigation form as opposed to tabs on a tab control).
And as noted, in general you should not need to requery a sub form, but the above VBA command WILL requery the form in question if that is your goal + question.
You can consider using a fully qualified forms path name in place of "me" as per above, but you want to avoid that type of code/syntax if possible.
As noted, you can requery the navigation sub form, but WHERE and WHEN the code resides that you attempting to run will affect the syntax you use.
From the main form to requery a form inside of the navigation form set, you would use this:
Me.NavigationSubform.Requery
But, in fact even more correct syntax would be this:
Me.NavigationSubform.Form.Requery
And if it was a sub sub form, then you would have this:
Me.NavigationSubform.Form.custChild.Form.Requery
However, it would be RARE to run such code from the main navigation form. And as noted if the code resides in the form that is part of the navigation set, then this code will work:
Me.custChild.Form.Requery
And last but not least:
If the form in question is on A DIFFERENT navigation tab, then you cannot re-query such forms since when using the navigation system.
Why?
Because with the navigation form system those other forms behind tabs are NOT YET loaded. What occurs is when you click on a different navigation tab, the current form is UN-LOADED and the new form is THEN loaded. So keep in mind that previous forms are also automatic un-loaded. This means you cannot reference controls on those PREVIOUS FORMS when using a navigation form as opposed to a tab control.
So this is why I stated it is VERY significant to distinguish between a tab control and navigation forms.
Without such distinctions between tabs and navigation forms, then any information provided here is going is unlikely to be of any use to you.
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada