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
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.
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
Re: Access form, refresh vs. requery methods
Indeed it does... from the help on Requery:
Quote:
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.