Results 1 to 5 of 5
  1. #1
    fuonge is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    8

    Load added record on Main form after inserting new record from popup form

    Hi I have a popup form that adds a new record. It refreshes now and reloads the whole database when I close the popup form.



    What I want to happen is to have the popup close, refresh then load the newly added record. How would I code that into my on close vba?


    Thank you.

  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,919
    Could have code in the popup form that requeries the main form then move to last record. This assumes the new record will be the last record of the main form. Otherwise, code would have to search for record ID and go to record.

    Then close the popup.
    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
    fuonge is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    8
    Thank you June7, could you write an example where it would requery then it would move to the max(PrimaryID)? Would it be like a recordset code?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Does the main form have unfiltered RecordSource - it displays all records from table?

    Forms!mainform.Requery
    DoCmd.GoToRecord acDataForm, "mainformname", acLast
    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
    fuonge is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    8
    Thank you!!

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

Similar Threads

  1. Replies: 7
    Last Post: 07-01-2015, 10:29 AM
  2. Replies: 3
    Last Post: 04-23-2014, 12:19 PM
  3. Replies: 11
    Last Post: 02-13-2012, 10:06 AM
  4. Replies: 1
    Last Post: 01-24-2012, 03:47 PM
  5. New record not being added to main form
    By hmcquade in forum Forms
    Replies: 10
    Last Post: 07-21-2011, 10:07 AM

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