Is there any way I can requery or perform the requery
method with out calling Me.Requery? I don't want to use
Me.Requery because it sets the form back to the first
record. I want to perform the requerying without setting
back to the first record.
Does your recordset include a unique record identifier (primary key), such as an
autonumber field? If yes, you can use the following approach to requery the form
and then return the form to the record it was on prior to the requery:
'***EXAMPLE START
'If no valid current record then exit sub
If IsNull(Me.ID.Value) Or Me.NewRecord Then _
Exit Sub
Dim lngID As Long
'Store primary key
lngID = Me.ID.Value
'Requery form
Me.Requery
'Restore form to prior record
With Me.RecordsetClone
'Find the key value stored in "lngID"
.FindFirst "ID=" & lngID
If Not .NoMatch Then
'Key value located, so move form to this record
Me.Bookmark = .Bookmark
End If
End With
'***EXAMPLE END
The above example assumes that the "ID" field is an autonumber (if using a
string value, Dim your variable accordingly and embed quotes around the
reference in the search string).