I would like to navigate to a record on a form by entering the 开发者_开发问答records absolute position in a textbox. So far miserable failure. Can anyone tell me how to do this?
You can use the recordset, or recordsetclone:
Set RS = frm.RecordsetClone
''Populate recordset
RS.MoveLast
RS.MoveFirst
If lngRecNo = 0 Or lngRecNo > RS.RecordCount Then
MsgBox "Cannot go to the specified record." & vbCrLf _
& "Please try again."
Else
''Counting from zero
RS.AbsolutePosition = lngRecNo - 1
frm.Bookmark = RS.Bookmark
End If
精彩评论