Cosmos75
Registered User.
- Local time
- Today, 01:04
- Joined
- Apr 22, 2002
- Messages
- 1,280
After searching the forum and reading the Access Help file, I still can't figure out what I am doing wrong.
What I am trying to do is to set the focus of a form back to the most recently added record.
It doesn't work, it keeps going back to the very first record. What am I doing wrong?
I am not doing a .Requery anywhere (so I am not destroying the bookmark) and am not getting the "Invalid Bookmark" message.
What I am trying to do is to set the focus of a form back to the most recently added record.
Code:
Private Sub Form_AfterUpdate()
Dim myDB As DAO.Database
Dim tblRST As DAO.Recordset
Set myDB = CurrentDb()
Set tblRST = Me.RecordsetClone
With tblRST
If .Bookmarkable Then
.Bookmark = .LastModified
varBookmark = .Bookmark
Me.Bookmark = varBookmark
.Close
End If
End With
myDB.Close
End Sub
I am not doing a .Requery anywhere (so I am not destroying the bookmark) and am not getting the "Invalid Bookmark" message.