Results 1 to 3 of 3
  1. #1
    Historypaul is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    64

    Updating form after updating and closing a popup window

    My main form has a list of all records in a continuous form format. When you click on one of them, the record is opened up in a popup window where you can edit the details. When I close the popup window, I want the original form to be updated with the info updated in the popup window.



    Now here's the kinda tricky part. I don't want to hard code the form name because the main form may not always be a subform of the same parent. I assume the easiest way would be to pass on the name of the form in open arguments as a string variable, then call for a refresh of that form on the "after update" event of the popup, or on the "Close" event. BUT... Has anybody designed a function that will return the full path name of the form object dynamically so I can pass it on as an open argument?

    A function like this seems like it would be a useful tool. I'm just hoping I'm not the one that has to write it.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Open the second form with acDialog parameter. This suspends code execution on the calling form until the second form closes. The next line of code can be:

    Me.Requery

    Don't understand "the main form may not always be a subform of the same parent" - how can a main form be a subform?
    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
    Historypaul is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    64
    Wow... So simple. So perfect. THANK YOU! Works great!

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

Similar Threads

  1. Replies: 7
    Last Post: 03-02-2014, 08:47 PM
  2. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  3. Change Switchboard popup window size
    By Rhemo in forum Access
    Replies: 9
    Last Post: 09-02-2012, 10:54 AM
  4. Automatically Closing Print Preview Window
    By chris.williams in forum Reports
    Replies: 5
    Last Post: 08-07-2012, 05:02 PM
  5. Updating Main form from a popup form
    By wdrspens in forum Forms
    Replies: 21
    Last Post: 06-13-2011, 01:34 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