Return to current record

Giganews Newsgroups
Subject: Return to current record
Posted by:  Patrick Finucane (patrickfinucane…
Date: Thu, 14 Nov 2019

it seems it has been a while.  I have forgotten so much in working with Access.

I have a form/subform.  There is some code called in the mainform that updates values in the subform.

The prior coder placed a Fsub.Refresh after the update and that sends the record to the top of the list.  I want it to remain on the current record.

This routine is called in multiple forms.  How to best stay on the current record?

I have
    Dim bmId As Bookmark
    Dim strM As String, strS As String
    strM = frmSelect.Name  'main form name
    strS = fsub.Name      'sub form name
    bmId = Forms![strM]![strS].Form.Bookmark  'blows up on this line
    Forms!frmSelect.Name!fsub.Name.Form.Bookmark = bmId

It blows up when I try to assign a bookmark to crID.  I forgot how to set or go  to bookmarks or the current record.  Any help is appreciated.