View Full Version : Return to same field after requery in subform


cjman
05-25-2011, 06:27 AM
I found this bit of code. It works to return me to the same subform field I was in prior to a requery. I am using Access 2010.

Dim strBookmark as String
strBookmark = Me.Bookmark
Me.Requery
Me.Bookmark = strBookmark
Me.Field.Setfocus

I had also tried this code if there is sequential numbering that is not skipped in the subform.
Dim Seq2 as Integer
Seq2 = Me.Seq
Me.Requery
DoCmd.GotoRecord , , , Seq2
Me.Field.Setfocus