Results 1 to 10 of 10
  1. #1
    cyberdog2711 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    5

    Unhappy Attempting to Refresh a Listbox on a NavigationSubform from a different "tab"

    Spent too much time trying to find what I think would be something simple.



    Problem is similar to this post; yet that user changed his work around (which I could easily do, but destroys the cleanliness I feel of the database).

    https://www.accessforums.net/forms/l...elp-40207.html

    Simply what I would like is to cite the specific "form" that's a tab on the navigation form.

    I know to cite the overall NavigationSubform is

    Forms!Mainform!NavigationSubform.Form!Object

    Though changing NavigationSubform will change the property of all 3 tabs on the Navigation Form, disallowing me to reference just one specific tab.

    Specifically what I am trying to do is in two parts, I have a Combobox on the main form with dates that affect choices made in other comboboxes/listboxes on all three tabs of the navform; for the "dynamic search" I would like the date combobox if/or when changed to refresh the listbox (this gives me an error if I am on a different "tab" because that listbox is not in that "tabs" form). The other side is a reset button that clears whatever information the user has entered; but alas there are multiple combo/list boxes across the 3 tabs/forms that need to be reset if the user so chooses. Likewise, this reset button is on the main form and I'd imagine needs to specify which object is on which tab so it can reference it properly.

    Currently trying to do either the reset on the dynamic search tab or changing the date on the static page results in
    Run-time error '2465'
    Mutual Fund Binder can't find the field 'object' referred to in your expression.
    ('object' changes depending on what it could not find)

    Debugging will reference the lines, but simply it just can't find w.e. object requested on the current tab cause it is only looking at the Navigationsubform not the specific tab.

    Database is attached and only includes general public mutual fund information. Multiple selection tab is still blank except a filler label.

    MFB Test.zip

    Be gentle I am still learning and getting a grasp of things

    I've tried things such as:
    Forms![Mutual Fund Binder]!NavigationSubform.Form![Dynamic Search]!Listbox.Requery
    Forms![Mutual Fund Binder]!NavigationSubform.Form![Dynamic Search].Listbox.Requery
    Forms![Mutual Fund Binder]!NavigationSubform.[Dynamic Search]!Listbox.Requery

    All result in a different errors including wrong syntax etc.

    Really appreciate any help I've spent an uncomfortable amount of time looking for this solution and testing numerous methods or contemplating other ways of doing it. Thank you!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    This is why I don't use Navigation form - they are difficult and confusing. I think it was intended for use in web database (did not download yours to check). Like it or not, my recommendation is to do what the other user did, abandon Navigation form.

    However, maybe this thread has solution https://www.accessforums.net/access/...xes-40936.html. Even if not a web database, maybe TempVars will resolve your issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Here is piece of info regarding NAvigation forms from MSDN - I tried it once, but after facing simalar issue, dropped the idea and resorted to tab control.
    Comparing the Navigation Form to the Tab Control

    You may wonder why you might use the new navigation form feature instead of the standard Tab control, which provides similar functionality. One reason, of course, is that the Tab control does not provide a mechanism for supporting a hierarchy of options, as does the navigation form. To enable users to select a main category, and then select sub-categories, the navigation form is the only choice.
    In addition, the load-time behavior is different for the two types of controls. The navigation form loads each child form or report on demand (that is, as you click the corresponding tab). The Tab control, however, loads all its child objects as it loads. Not only does this affect performance (when you open the main form, you must wait while the Tab control loads all its child objects), but it can also make it difficult when handling querying data. Because the navigation form loads each form as you click the corresponding tab, you can be certain that users see the most current data, without a need for you to create specific code that re-queries the form as users click each tab. This also means that the navigation form does not provide a specific event as you click each tab. Instead, place the load-time code in each form or report Load or Open event handler.
    Here is link to it - http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx
    This may be the reason why the controls on other tabs not responding as you expect.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    That is a very good summation of the issue. Yes, the form you want to reference is no longer available when you switch to another tab. Forms are actually loaded as need to the SAME place, therefore only one at a time is open.

    Hence the suggestion for TempVars.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    cyberdog2711 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    5
    Might there be an alternative then to using a Navigation form? I gravitated to this idea after seeing a sample database and liked the ease of use for the end user. Suppose the alternative seems to be using just subforms in general and having a button that switches between them (essentially a nav form without being a nav form, by my understanding)?

    My only other solution is to strip the reset button and the date combobox off the main form and put them directly onto each subform (if continuing to use the Navigation form) but this seems to end up cluttering the Navsubforms and only duplicates things unnessecairly.

    Not sure how to go about implementing the tempvars, also my DB isn't web based which could be reason enough to scrap the Nav forms but would really like to hear if there is a simple way of referencing that one individual tab if someone has that knowledge.

    Thanks for the quick replies; this reply is in response to June7's 1st comment.

    I'll look into the MSDN reference, and like I said might just try going about using Tab Control.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    If it wasn't made clear before, I will restate: Referencing the other tab is fruitless because that form is no longer open when you went to a different tab.

    Options I know:

    1. Tab control and subforms

    2. TempVars - might require macros, don't know if they can be used in VBA - I have never used TempVars

    3. VBA code that either sets a global variable or a textbox that sits on the main form independent of the navigation tabs then reference the variable or textbox
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Before discarding the idea to use NAvigation forms, think whether do you need to requery controls on other nav forms before you move on to them ? If you put the requery code in the forms' open or load event, will they work ?
    Because the navigation form loads each form as you click the corresponding tab, you can be certain that users see the most current data, without a need for you to create specific code that re-queries the form as users click each tab. This also means that the navigation form does not provide a specific event as you click each tab. Instead, place the load-time code in each form or report Load or Open event handler.
    My thoughts are based on reading the above quote from MSDN.

  8. #8
    cyberdog2711 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    5
    Is an interesting perspective, but don't think it's applicable as the date combobox if changed should update the listbox, so the form may already be opened and senseless to move tabs just to requery.

    I had an idea to put an IF into the requery, that will only run if the tab is currently selected. I don't know if thats an option to do, I thought at first: enabled=true (though newbish in that that control is something entirely different).

    But my logic for this is that it will only try to requery the listbox if and only if the dynamic search tab is currently selected/highlighted with that form loaded. Otherwise it would not attempt to requery and avoid looking for a listbox on the form that isnt there.



    The tabs are pretty independant of themselves nothing passes between them; which is what I understood from
    Quote Originally Posted by amrut View Post
    think whether do you need to requery controls on other nav forms before you move on to them ?

    But alas I do think tab control is the way to go, as from quick searching the only draw back seems to be load times? Which in my case I don't think should be too much of an issue as I am dealing with smallish numbers of records at most 4800? But most loaded at a time may only be 400-500ish on the dynamic search list box.

    In summation: maybe you know of a way on knowing when a button is currently active/selected in which I could write this into an if statement on the requery. If not I may move ahead with tab controls as that seems to be the way to go anyways.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have ventured down similar paths as others here have. The only thing I could add would be to say that my preference is to avoid the navigation control. I have avoided it to the point that I created my own Navigation Control (template). I built a form and placed a couple rows of buttons and toggles. Then I created an enormous amount of code to simulate what the navigation control does, along with tables to help keep track of everything (much like the switchboard manger does). It took about 4 days, or what normal people would consider to be a work week, to complete.

    I mention this because I like the look of the navigation control but can not live with the limitations. For my purposes and for desktop apps, the Navigation Control falls short. Having said that, I find this thread interesting and I still believe there is a place for the navigation control. Right now, any option I imagine that might squeeze additional functionality from the Navigation Control is labor intensive and does not include the actual solution.

  10. #10
    cyberdog2711 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    5
    Thanks all for the help and insight.

    Would be nice if Access made an easy way to reference the tabs in a simple manner, maybe their next go around.

    Off to learn my way through tab control.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 27
    Last Post: 12-17-2013, 08:44 AM
  2. Replies: 7
    Last Post: 06-27-2013, 10:56 AM
  3. Replies: 2
    Last Post: 02-21-2012, 01:35 PM
  4. Replies: 16
    Last Post: 11-01-2011, 01:35 PM
  5. Using ListBox value as "Body of outlook task"
    By AccessFreak in forum Database Design
    Replies: 3
    Last Post: 05-07-2011, 04:40 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums