Requery a subform that is in a navigation form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jalbright1957
    New Member
    • Mar 2016
    • 25

    Requery a subform that is in a navigation form

    This topic has quite a few posts with various remedies that I have read but haven't been able to locate one that works with what I am doing. I use Access 2016. I have a navigation form. In the first tab of the navigation form, there are (3) subforms which contain data from five separate tables, all of which share a 1 to many relationship among themselves.

    The subform that I cannot get to update displays customer contacts in a continuous form. The contacts table are (child records) of a customer table (parent record).

    I have a command button within the the same tab of the navigation form to Add a new contact. This launches a separate form (call it a popup) to add a new contact and then returns to the navigation form after saving. The record gets added but I have to navigate away from the current record getting the new contact and then back in order to see the changes. Before putting these forms into the navigation form, it all worked fine.

    What is the proper method to have the continuous form update automatically upon returning? I have tried a myriad of the Forms! and Me! syntax from the various examples but all fail with a message similar to: the continuous form is unknown.
  • PhilOfWalton
    Recognized Expert Top Contributor
    • Mar 2016
    • 1430

    #2
    I presume you have tries something like thin on the AfterUpdate of your Pop up

    Code:
        Forms!MainForm!Subform.Requery
    It's worth checking that the subform name has the same as the subform SourceObject

    Phil

    Comment

    • jalbright1957
      New Member
      • Mar 2016
      • 25

      #3
      Thanks for your response Phil,
      Yes, I have been trying statements that are similar and by all rights, should have worked. Well, they would have worked if I had the name of the subform correct. The name of the entire navigation form is frmContractorNa vigation but what I missed was the name of the subform which I discovered is the entire area that encompasses the 3 subforms. That particular area of the Navigation form is somewhat difficult to select. I thought I was supposed to reference the name of the customer contacts subform. The correct code follows:
      Code:
      Forms("frmContractorNavigation").[frmDisplayContractorSubForm].[Form].[frmCustomerContactGrid].Requery

      Comment

      Working...