vfp 想要实现两个表格控件同时翻页
运行结果:挂起:
上一页代码:
if pno = 1
messagebox("first")
else
select(select(1))
thisform.lockscreen = .t.
close databases
select adminl
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=1 into cursor ji &&临时表ji
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=0 into cursor ou &&临时表ou
select ji
rc = reccount() &&总记录
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10)) &&总页数
pno = pno - 1 &&当前为第几页-1(上一页)
rno = pno*10 - 9 &&当前页第一条记录为第几条记录-9(上一页第一条记录为第几条记录)
if file("jitemp")
if used("jitemp")
select jitemp
use
endif
delete file ji.temp
endif
goto(rno)
copy to jitemp next 10
select (select(1))
use jitemp
thisform.pageframe1.page5.grid1.recordsourcetype = 1
thisform.pageframe1.page5.grid1.recordsource = "jitemp"
select ou
rc = reccount() &&总记录
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10)) &&总页数
pno = pno - 1 &&当前为第几页-1(上一页)
rno = pno*10 - 9 &&当前页第一条记录为第几条记录-9(上一页第一条记录为第几条记录)
if file("outemp")
if used("outemp")
select outemp
use
endif
delete file ou.temp
endif
goto(rno)
copy to outemp next 10
select (select(1))
use outemp
thisform.pageframe1.page5.grid2.recordsourcetype = 1
thisform.pageframe1.page5.grid2.recordsource = "outemp"
thisform.lockscreen = .f.
endif
下一页代码:
if pno = pc &&if 当前页数等于总页数(最后一页)
messagebox("last")
else
thisform.lockscreen = .t.
close databases
select (select(1))
select adminl &&查询adminl表
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=1 into cursor ji &&临时表ji
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=0 into cursor ou &&临时表ou
select ji
rc = reccount()
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))
pno = pno + 1
rno = pno*10-9
if file("jitemp")
if used("jitemp")
select jitemp
use
endif
delete file ji.temp
endif
goto(rno)
if rc-rno<10
copy to jitemp next (rc-rno+1)
else
copy to jitemp next 10
endif
select(select(1))
use jitemp
thisform.pageframe1.page5.grid1.recordsourcetype = 1
thisform.pageframe1.page5.grid1.recordsource = "jitemp"
select ou
rc = reccount()
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))
pno = pno+1
rno = pno*10-9
if file("outemp")
if used("outemp")
select outemp
use
endif
delete file ou.temp
endif
goto(rno)
if rc-rno<10
copy to outemp next (rc-rno+1)
else
copy to outemp next 10
endif
select(select(1))
use outemp
thisform.pageframe1.page5.grid2.recordsourcetype = 1
thisform.pageframe1.page5.grid2.recordsource = "outemp"
thisform.lockscreen = .f.
endif
请问出现了什么错误??求大佬教