Results 1 to 5 of 5
  1. #1
    ahkleine is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    3

    Update a Form

    Hello everybody



    My problem is: I have 2 MS Acces forms opened in my application. The first form is a form in table style. The second form is a pop up form. In the first form there is a button to add a record and opens the pop up form. The problem is: when I add a record I want that access immediatly shows the new record in the first form. I have tried to do this with a timer in the first form. But this is not very nice. VBA command REQUERY does not work, even Repaint, Rfresh does not work. Who can tell me the solution

    Regards Albert

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Requery should work. Where did you have it? I'd try either in the code that closes the second form or the activate event of the first.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ahkleine is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    Requery should work. Where did you have it? I'd try either in the code that closes the second form or the activate event of the first.
    In the propertysheet of the form I put the next vba code:

    Private Sub Form_Activate()
    DoCmd.Requery

    End Sub

    I Put the same code in the buttom that close the second form (the pop up form)

    both dos not work in my forms

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Record entered on popup form must first be committed to table. Record is committed when: 1. close table/query/form; or 2. move to another record; or 3. run code to save.

    Show code that opens the popup form.

    Example from my db:
    Code:
    Private Sub btnEdit_Click()
    DoCmd.OpenForm "EditSubmit", , , , , acDialog
    Me.Refresh
    End Sub
    acDialog suspends code execution in the main form until the popup form closes. Code execution resumes with the Refresh (or Requery) of the main form.
    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
    ahkleine is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    3
    June7

    It is working. Thanks for your help

    regards Albert Kleine

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

Similar Threads

  1. Replies: 7
    Last Post: 07-19-2016, 05:28 PM
  2. Replies: 6
    Last Post: 11-05-2014, 05:27 PM
  3. Update Table after Record Update with Form
    By speciman_A in forum Forms
    Replies: 25
    Last Post: 10-31-2014, 01:00 PM
  4. Entry Update Form Problem with the update
    By cuddles in forum Forms
    Replies: 1
    Last Post: 05-30-2014, 02:38 PM
  5. Replies: 7
    Last Post: 09-21-2012, 11:09 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