Requery and Refresh

Why is it that using the requery command can appear to caused what appears to be prolonged requery that last 5 to 10 seconds?  I says appears as the computer screen freezes and flicker for a few seconds before the user has control of the system again.

Ashley
jezellaAsked:
Who is Participating?
 
bknouseCommented:
The requery action or method actually requeries the underlying datasource of the specified object.  This creates a new recordset on which the object is based.  After the requery any records changed that don't match the criteria or deleted records are not returned.  Any new records added that match the criteria are included.
The refresh command updates the current recordset.  That is any records deleted are removed.  Even though records may have changed and no longer meet the entered criteria, those records remain.  Any new records added since the last requery are not returned.
Depending on the size of the underlying data, a requery could require a few seconds to minutes.

Brent
0
 
stawickiCommented:
It can depend on how you make the requery - the following  text in quotes is from microsoft access HELP -   is this a case where you really want to be using refresh rather than requery?


"If you want to requery a control that isn't on the active object, you must use the Requery method in Visual Basic, not the Requery action or its corresponding Requery method of the DoCmd object. The Requery method in Visual Basic is faster than the Requery action or the DoCmd.Requery method. In addition, when you use the Requery action or the DoCmd.Requery method, Microsoft Access closes the query and reloads it from the database, but when you use the Requery method, Microsoft Access reruns the query without closing and reloading it. Note that the ActiveX Data Object (ADO) Requery method works the same way as the Microsoft Access Requery method"
0
 
heer2351Commented:
bknouse is almost correct, the following is a quote from the access help:

<quote>
The Refresh method shows only changes made to records in the current set. Since the Refresh method doesn't actually requery the database, the current set won't include records that have been added or exclude records that have been deleted since the database was last requeried. Nor will it exclude records that no longer satisfy the criteria of the query or filter. To requery the database, use the Requery method. When the record source for a form is requeried, the current set of records will accurately reflect all data in the record source.
</quote>

But to answer your question, since a requery realy requeries the database it can take a while depending on the speed of the query. You could try to enhance the performance by tuning the query.
0
 
ornicarCommented:
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0
 
jadedataMS Access Systems CreatorCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: bknouse {http:#9789588} & heer2351 {http:#9791650}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jadedata
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.