Applies ToAccess for Microsoft 365 Access 2024 Access 2021 Access 2019 Access 2016

When you share a database over a network, Microsoft Access updates the information at set intervals. To view the most current data, refresh the records from either Datasheet or Form view, on the Home tab, click Refresh All >Refresh. The refresh process updates the existing data in a datasheet or form, and doesn’t reorder records, display new records, or remove any deleted records or records that no longer meet specified criteria. For a more specific or a thorough update, use a macro to requery the data.

Note:  Running the requery process can be time consuming depending on the size of the recordset.

What do you want to do?

Refresh data

  • Do one of the following:

    • To refresh the records in Datasheet or Form view, on the Home tab, in the Records group, click Refresh All, and then click Refresh.

    • To refresh the records in PivotTable or PivotChart view, on the Design tab, in the Data group, click Refresh Pivot.

    • Press SHIFT+F9.

Top of Page

Set the refresh interval

You can set the interval at which Access refreshes data. By default, Access refreshes data every 60 seconds.

  1. Click the Office Button. The Outspace appears.

  2. In the left pane of the Outspace, click Options.

  3. In the left pane of Access Options dialog box, click Advanced.

  4. In the right pane, under Advanced, specify a value for Refresh interval (sec).

Top of Page

Use a macro to requery data

If you want data to be requeried automatically when an event occurs, you can create a macro and attach it to the event. For example, suppose that you want to requery the data in a form whenever the form receives the focus. You could create a macro and attach it to the form's On Got Focus event, by using the following procedure:

  1. On the Create tab, in the Other group, click Macro. If this command is unavailable, click the arrow beneath either the Module or the Class Module button, and then click Macro.

  2. Click the arrow in the box beside the green plus symbol (+), and then click Requery.

  3. Save the macro, using the name Requery, and then close the Macro Builder.

  4. Open the form that you want in Design view. If the property sheet is not displayed, press F4 to display it.

  5. Make sure that the form itself is selected. Then, on the property sheet, click the Event tab.

  6. On the Event tab, click the arrow in the On Got Focus property, and then click the name of the macro — Requery.

  7. Save the form.

Top of Page

Use code to requery data

You can also use code to requery data automatically. Suppose that you want to requery the data in a form whenever the form receives the focus. You could create a module and attach it to the form's On Got Focus event, by using the following procedure:

  1. Open the form that you want in Design view. If the property sheet is not displayed, press F4 to display it.

  2. Make sure that the form itself is selected. Then, on the property sheet, click the Event tab.

  3. On the Event tab, in the On Got Focus property, click the Build button Builder button.

  4. In the Choose Builder dialog box, click Code Builder.

    A new module opens in the Visual Basic Editor.

  5. Type Me.Requery, and then close the Visual Basic Editor.

  6. Save the form.

Top of Page

Requery data in an Access web app

Access web app queries run on the server. You would use the RequeryRecords macro to requery data in an Access web app. This macro requires the current recordset.

  1. Open the form that you want, click Actions, and then click On Current.

  2. From the Action Catalog, click RequeryRecords. If you choose to leave blank the Where=, no additional filtering is performed on the results and by leaving the OrderBy= as blank, no specific sorting is performed.

  3. Save the form.

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.