Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Massachusetts, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Refresh (2002 (XP))

    I need to have a form refresh itself. There is a button on this continuous form (A) that that launches a new form ([img]/forums/images/smilies/cool.gif[/img] to add records. once the the new record is added on ([img]/forums/images/smilies/cool.gif[/img] you exit and are returned to (A). I need (A) to be refreshed upon return. I have tried the refresh command on almost every event for form (A). Is there a way to refresh form (A) when I click the exit button on ([img]/forums/images/smilies/cool.gif[/img]? Sorry if this is confusing...

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form Refresh (2002 (XP))

    There are several ways to do this, but you're going to need to requery the form, not refresh it. The simplest way is to go to the code behind the button that launches the second form and make sure that the second form is being opened as a dialog. That will stop the code from proceeding until you close the popup form. Then in the line after that, simply put Me.Requery.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form Refresh (2002 (XP))

    As Charlotte explained, you need to Requery, not Refresh. Just so you understand, a Refresh gives you the current information for all records in your form's recordset. So if another user changed something in one of these records, your screen display would be properly updated. However, a Refresh won't get new records added after you first created your recordset. A Requery on the other hand goes out and recreates the form's recordset from scratch, so it also gets all new records added since you first created (or the last time you requeried) your form's recordset. Access will automatically refresh your recordset periodically, but you have to requery on your own.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •