The Refresh method immediately updates the records in the underlying record source for a specified form or datasheet to reflect changes made to the data by you and other users in a multiuser environment.
form.Refresh
The Refresh method uses the following argument.
Argument |
Description |
form |
A Form object that represents the form to refresh |
Using this method is equivalent to clicking Refresh on the Records menu.
Microsoft Access refreshes records automatically, based on the Refresh Interval setting on the Advanced tab of the Options dialog box, available by clicking Options on the Tools menu. ODBC data sources are refreshed based on the ODBC Refresh Interval setting on the Advanced tab of the Options dialog box. You can use the Refresh method to view changes that have been made to the current set of records in a form or datasheet since the record source underlying the form or datasheet was last refreshed.
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 will not 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.
Notes
Event Properties; Form Object; GetOption, SetOption Methods; Recalc Method; Requery Method.
The following example uses the Refresh method to update the records in the underlying record source for the form Customers whenever the form receives the focus.
Private Sub Form_Activate() Forms!Customers.RefreshSub