SetFocus to specific row of datasheet? (1 Viewer)

treva26

Registered User.
Local time
Yesterday, 22:44
Joined
Sep 19, 2007
Messages
113
I have a subform in datasheet view.
On it I have an AfterUpdate vba sub, which includes a Me.Form.Requery command.

The problem is this makes the cursor jump to the top left field of the table.
I can make it go to the top of the column in question with Me.Quantity.SetFocus

But is it possible to SetFocus to the row that it was in before the Requery?
 

boblarson

Smeghead
Local time
Yesterday, 22:44
Joined
Jan 12, 2001
Messages
32,059
Just do this:
Code:
Dim strBookmark As String

strBookmark = Me.Recordset.Bookmark
Me.Requery
Me.Recordset.Bookmark = strBookmark
 

treva26

Registered User.
Local time
Yesterday, 22:44
Joined
Sep 19, 2007
Messages
113
Beautiful thank you :)
 

boblarson

Smeghead
Local time
Yesterday, 22:44
Joined
Jan 12, 2001
Messages
32,059
 

Users who are viewing this thread

Top Bottom