只需一步,快速开始
您需要 登录 才可以下载或查看,没有帐号?注册
使用道具 举报
以下是引用gaoqiwen在2005-9-7 15:34:00的发言: Select Case way Case True '向上移动 If currentPage = 1 Then '判断当前是否为1,如果是则提示无法移动 MsgBox "已经是第一页!", vbInformation, "提示" Else '选择前N条数据,ID在(当前页-1)*条数 之外 sql = "select top " & IntCount & " * from student where " _ & " id not in (select top " & (currentPage - 1) * IntCount & " id from student)" Me.dqpage = Me.dqpage - 1 '更新当前页 Me.student_sub.Form.RecordSource = sql '更改子窗体数据源 Me.student_sub.Requery '刷新子窗体 End If Case False '向下移动 If currentPage = MaxPage Then MsgBox "已经是最后一页!", vbInformation, "提示" Else ' sql = "select top " & IntCount & " * from student where " _ & " id not in (select top " & currentPage * IntCount & " id from student)" Me.dqpage = Me.dqpage + 1 Me.student_sub.Form.RecordSource = sql Me.student_sub.Requery End If 建议将红色字代码换为: if currentPage - 2 = 0 then sql = "select top " & IntCount & " * from student " else sql = "select top " & IntCount & " * from student where " _ & " id not in (select top " & (currentPage - 2) * IntCount & " id from student)" endif
本版积分规则 发表回复 回帖后跳转到最后一页
|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )
GMT+8, 2024-11-19 06:23 , Processed in 0.088907 second(s), 34 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.