Refresh Method

See AlsolanRefreshSee                 Example 1lanRefreshEx1>Low              Example 2lanRefreshEx2>Low

Description

Forces an immediate repaint or update of a form, control, or object.

Syntax

[formname. | controlname. | objectname. ]Refresh

Remarks

Use this method to force a complete repaint of a form or control.  This is useful when you want a form to display completely while another form is loading, or when you want to update the contents of a system list box, such as a file list box, or the data structures of a data control.

Refresh cannot be used on MDI forms, but can be used on MDI child forms.  You cannot use Refresh on menu or timer controls.

Generally, painting a form or control is handled automatically while no events are occurring.  However, there may be situations where you want the form or control updated immediately.  For example, if you use a file list box, a directory list box, or a drive list box to show the current status of the file system, you can use Refresh to update the list whenever a change is made to the directory structure.

You can use the Refresh method on a data control to open or reopen the database (if the DatabaseName, ReadOnly, Exclusive, or Connect properties have changed) and rebuild the Dynaset in the control's Recordset property.