PC Review


Reply
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average.

Difference between Requery and Refresh method

 
 
Don
Guest
Posts: n/a
 
      10th Jul 2003
I'm using a access 97 application. What's the difference
between using the Requery or Refresh method of the form.

Thanks

Don
 
Reply With Quote
 
 
 
 
Albert D. Kallal
Guest
Posts: n/a
 
      10th Jul 2003
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.
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
(E-Mail Removed)
http://www.attcanada.net/~kallal.msn


 
Reply With Quote
 
 
 
 
Bruce M. Thompson
Guest
Posts: n/a
 
      10th Jul 2003
<Reposted message>

> 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.

--
Bruce M. Thompson, Microsoft Access MVP
(E-Mail Removed) (See the Access FAQ at http://www.mvps.org/access)
>>No Email, Please. Keep all communications

within the newsgroups so that all might benefit.<<


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between method overridding and method overloading Ratnakar .N Microsoft C# .NET 1 15th Oct 2006 01:53 PM
Difference between bin and obj directories and difference between project references and dll references jakk Microsoft ASP .NET 4 22nd Mar 2005 10:23 PM
Diff between refresh & requery Andrew Backer Microsoft Access Forms 2 9th Aug 2004 10:21 PM
Difference between Delete method and RemoveRow method CW Microsoft ASP .NET 0 1st Apr 2004 02:07 AM
refresh refresh refresh refresh JP Microsoft Powerpoint 1 15th Aug 2003 04:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 PM.