|
关键代码:
Private Function ChangeRstPage(frm As Form, rst As DAO.Recordset, sFldID As String, iPageRecCount As Integer, iCurrentPage As Integer)
' 将按页码筛选后的记录集作为窗体记录集
Dim iStartNumber As Integer
Dim lngStartID As Long
Dim lngLastID As Long
iStartNumber = (iCurrentPage - 1) * iPageRecCount
With rst
If .RecordCount > 0 Then
.MoveFirst
.Move iStartNumber
If .EOF Then Exit Function
lngStartID = .Fields(sFldID)
.Move iPageRecCount - 1
If .EOF Then .MoveLast
lngLastID = .Fields(sFldID)
.Filter = sFldID & " Between " & lngStartID & " And " & lngLastID
End If
Set frm.Recordset = .OpenRecordset
End With
End Function |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|