开发者

ms access 2003 navigate to absolute position of record

开发者 https://www.devze.com 2023-01-25 03:33 出处:网络
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 record

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
0

精彩评论

暂无评论...
验证码 换一张
取 消