Refreshing a form and returning to last record on

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I am doing is that I have a detail form that I allow a user to edit more
information. When they close the detail form, I refresh the main form, but
it returns them to the top of the form. Is there a way to back to record
that the user was last on. I tried the goto record method and it did not
seem to do anything. I use the refresh method on the close of the detail
form.

Thanks in advance
 
John said:
What I am doing is that I have a detail form that I allow a user to edit more
information. When they close the detail form, I refresh the main form, but
it returns them to the top of the form. Is there a way to back to record
that the user was last on. I tried the goto record method and it did not
seem to do anything. I use the refresh method on the close of the detail
form.


Presumably the detail form is opened in dialog mode.

If so, save the current record's PK field, run the other
form, do the requery and then find the record with the saved
PK:

Dim lngPK As Long
lngPK = Me.txtPK
DoCmd.OpenForm "details", . . . , _
WindowMode:=acDialog
Me.Requery
With Me.RecordsetClone
.FindFirst "PK = " & lngPK
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End If
 
Back
Top