Results 1 to 4 of 4

Thread: Access form, refresh vs. requery methods

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Question Access form, refresh vs. requery methods

    Could someone clarify the difference between the me.refresh & me.requery methods on an Access form that's got fields bound to a table?

    What's the difference?
    Should they both be used? and when?
    If both, should they be done in a particular order? e.g. refresh then requery.

    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Access form, refresh vs. requery methods

    Based on the assumption that they are the same as VB6:

    Requery - reloads the data. As the form is bound, should also display the appropriate record.

    Refresh - does a simple graphical update. It just redraws the form as it is at that moment. As a general rule that will happen automatically, so you only need to use it when you have code taking a long time to run (and the form goes 'white').


    To check that these assumptions are correct, see the help for those methods.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Re: Access form, refresh vs. requery methods

    Actually, for an Access form I think it's .Repaint that does the graphical redrawing of the form
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Access form, refresh vs. requery methods

    Indeed it does... from the help on Requery:
    The Requery method updates the data underlying a form or control to reflect records that are new to or have been deleted from the record source since it was last requeried.

    The Refresh method shows only changes that have been made to the current set of records; it doesn't reflect new records or deleted records in the record source.

    The Repaint method simply repaints the specified form and its controls.

Posting Permissions

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



Click Here to Expand Forum to Full Width