Results 1 to 3 of 3
  1. #1
    onechriswhite is offline Novice
    Windows Vista Access 2002 (version 10.0)
    Join Date
    Jul 2010
    Posts
    22

    Refresh data on form after returning from a related form


    Using Access 10 on Windows 7, and getting very frustrated!
    I have a form which displays data from a couple of queries This data is related to student test marks. On this form is also a command button which takes you to another form where you need to change some data, i.e. change some test marks.

    On closing this second form and returning to the first, the data from the queries doesn't refresh. If I manually click "Refresh" at the top, then the data refreshes and all is fine.

    I want some code or a macro that will trigger a refresh at the right time (as the second form is closing will be ideal). I have tried all sorts of refresh and requery commands but to no avail. Please help!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    In the 2nd form, when you click the SAVE button, it will
    save the data
    refresh the 1st main form by calling its refresh event: forms!frmMain.requery
    close the form (form 2)

    now you are back on the main form refreshed.
    you can also make PUBLIC sub in the form to call from other forms.

    form 1:
    Code:
    public sub RefreshMyData()
      me.requery 
    end Sub
    form 2:
    forms!frmMain.RefreshMyData

  3. #3
    onechriswhite is offline Novice
    Windows Vista Access 2002 (version 10.0)
    Join Date
    Jul 2010
    Posts
    22
    Great, thanks. Calling a main form requery on the second form's close action solved the problem

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

Similar Threads

  1. Need to refresh form to display updated data
    By pledbetter in forum Forms
    Replies: 3
    Last Post: 01-02-2014, 01:20 PM
  2. Replies: 11
    Last Post: 01-10-2013, 06:23 PM
  3. Replies: 1
    Last Post: 07-16-2012, 02:10 PM
  4. Refresh data on menu form
    By bibbyd01 in forum Forms
    Replies: 3
    Last Post: 04-19-2012, 08:48 AM
  5. Replies: 2
    Last Post: 07-16-2011, 07:56 PM

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