keyongtech


  keyongtech > access.* > access.forms > 07/2003

 #1  
07-10-03, 05:42 PM
Don
I'm using a access 97 application. What's the difference
between using the Requery or Refresh method of the form.

Thanks

Don
 #2  
07-10-03, 06:01 PM
Albert D. Kallal
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.
 #3  
07-10-03, 08:16 PM
Bruce M. Thompson
<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.
Similar Threads
Refresh/ Requery

I have a delivery slip form, I have a button that when clicked opens the project form to edit or enter a new project. What I would like to have happen is that when the form...

Refresh, requery, or what?

I have a form with a subform. The data source for the subform is a table. On the main form is a command button which, when clicked, opens a pop up form. When the pop up form...

Refresh or requery. Where, please?

Hi! I have a form based in T_Ocorr. In this form there are a cboOcorr. When I click in cboOcorr row, open another form, based in query with a condition to show us only...

Requery/Refresh

I have form [frm_NewQuote] where I have several comboboxes based off queries. The Queries run off based off what ever my [ModelID] is in the form. I need to know how to...

Refresh or Requery?

I have a Party edit form that should always pull the Party_ID from another Party command of a Party select form. However, when I select the Party from the select form, the...


All times are GMT. The time now is 10:01 PM. | Privacy Policy