Results 1 to 5 of 5
  1. #1
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107

    NavigationSubForm Reload Data

    I have a NavigationSubForm that targets a report, and outside the NavigationSubForm there is a date field and a button that filters the report according to the date field.
    On the click event of the button, I changed the NavigationControl0.SelectedTab.NavigationTargetNam e and NavigationControl0.SelectedTab.NavigationWhereClau se
    The problem is the NavigationSubForm will not refresh automatically, I need to click on the selected tab again to refresh the data.
    I tried to perform a selectedtab click but it didn't work. Also I tried to requery the NavigationControl0 and refresh the NavigationSubForm but also didn't work.
    Is there a way to allow a NavigationSubForm refresh its data after changing its NavigationTargetName and NavigationWhereClause without clicking on the selected tab?

  2. #2
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    I found the solution, I used DoCmd.BrowseTo

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I have read that Me.NavigationSubForm.Form.Requery should work but it does not for me. I tried various versions using Requery, Refresh, Repaint (including Me.NavigationSubform.Requery and Me.NavigationButton7.Requery) - none work. Also tried: CommandBars.ExecuteMso "DataRefreshAll".

    Now I see you found solution. What did you use for the BrowseTo arguments?
    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.

  4. #4
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    DoCmd.BrowseTo acBrowseToReport, "Add report name here", "Main.NavigationSubform", "Add filter here"
    Replace Main.NavigationSubform with the path to your NavigationSubform
    You could also type Main.NavigationSubform>MyReports.NavigationSubform if you have a NavigationSubform inside another NavigationSubform, in this case you will have to change Main and MyReports with your own pathes

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Finally figured out the syntax.

    So why are you changing NavigationTargetName?
    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.

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

Similar Threads

  1. Filtering NavigationSubform in VBA
    By AccessPower in forum Programming
    Replies: 2
    Last Post: 02-13-2017, 12:11 PM
  2. Replies: 5
    Last Post: 08-08-2013, 06:20 PM
  3. NavigationSubform Not Populating Records
    By altemir in forum Forms
    Replies: 3
    Last Post: 04-30-2012, 03:19 PM
  4. Replies: 2
    Last Post: 12-17-2010, 11:12 PM
  5. How can I reload data on a form?
    By MrC in forum Forms
    Replies: 2
    Last Post: 07-21-2010, 02:58 AM

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