Open forms are refreshed automatically. The frequency of this is governed by
the refresh interval setting in Tools | Options (Advanced tab). A form can
be refreshed at any time, however, with:
Me.Refresh
Refreshing an open form updates the data for all existing records, but does
not add any new records inserted by another user or remove from view any
records deleted by another user. For that you need to explicitly requery the
form with:
Me.Requery
When a form is opened it will show the current data, so you only need to
concern yourself with the above in the context of open forms. If the default
refresh interval of 60 seconds is too infrequent this can be changed to a
lower one in Options, but this will increase network traffic, so a balance
has to be struck. A better strategy might be to explicitly refresh or
requery the form when some user action makes this desirable. Note, however,
that requerying a form moves its record pointer to the first record, so if
you want to stay on the current record you need to grab its primary key value
and then navigate back to it after the requery like so:
Dim rst As Object
Dim varID As Variant
varID = Me.MyID
Me.Requery
Set rst = Me.Recordset.Clone
With rst
If Not IsNull(varID) Then
.FindFirst "MyID = " & varID
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
Else
DoCmd.GoToRecord acForm, Me.Name, acNewRec
End If
End With
Ken Sheridan
Stafford, England