Difference between Requery and Refresh method

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I'm using a access 97 application. What's the difference
between using the Requery or Refresh method of the form.

Thanks

Don
 
Requery causes the whole reocrdset for the form to be re-loaded. This also
means that all bookmarks, and even your current position is lost. It is
essentially the same as re-loading the form with the records.

A refresh simply writes out the current record to disk. If you are
displaying more the one record, then those records that changed by other
users are also updated.

However, a me.refresh does NOT re-load the reocrdset. It does not change
your position. It is does NOT invalidate all bookmarks. This, this also
means that it will not show new records that have been added.

Generally, you can think of me.refresh as:
write my current record to disk if it needs to be.


So, for example if you wanted a button to print the current record to a
report, then before you launch the report, you would need to write the
current record to disk. (other wise the report will NOT show your changes
until you move off of the current record, and then move back)

So, to prevent the need to move off of the record, you could use:

me.refresh
docmd.openreprot "the reprot",,,"id = " & me.id

Of course, many people have pointed out to me that me.refresh can cause
additional network traffic since all records of the form are re-freshed

So, to really only write the current record to disk, you can/should use:

if me.dirty = true then
me.dirty = false
end if

The above also forces a disk write.

However, since all my forms generally only display ONE record, I as a habit
use me.refresh. My continoues forms are useally quite limitned in the number
of reocrds also, so again, I perfer me.refresh.
 
I'm using a access 97 application. What's the difference
between using the Requery or Refresh method of the form.

Requery re-opens the form's recordset from scratch and will reflect all
changes, additions and deletions from the source tables. Refresh merely
updates the existing recordset in memory and shows only changes in existing
data, ignoring any additions or deletions.
 
Back
Top