回复 3楼 sdta
页面2 init:
select fjpb01
*!*
选择激活上述表的工作区
*!*
set order to 一批号
&& 一批号
go bottom
set multilocks on
*!*
设置成可以进行多个记录锁定的配置
=cursorsetprop("buffering",3)
*!*
设置缓冲区环境为3,即表示行缓冲设定,即指针所指的那个记录,即只是一个记录
thisform.Refresh
命令按钮组中保存按钮的:click
CASE this.Value=3
cmessagetext="确定要保存吗?"
ndialogboxtype=4+32+0
ctitlebartext="信息窗口"
nanswer=messagebox(cmessagetext,ndialogboxtype,ctitlebartext)
do case
case
nanswer=6
gh=0
ph=0
jzdh=0
xmph=0
mpph=0
jzrq=""
gh=thisform.pageframe1.page1.pageframe1.page2.一罐号1.value
ph=thisform.pageframe1.page1.pageframe1.page2.一批号1.value
jzdh=thisform.pageframe1.page1.pageframe1.page2.菌种代号1.value
xmph=thisform.pageframe1.page1.pageframe1.page2.斜面批号1.value
mpph=thisform.pageframe1.page1.pageframe1.page2.母瓶批号1.value
jzrq=thisform.pageframe1.page1.pageframe1.page2.一接种日期1.value
IF
EMPTY(gh) .or. EMPTY(ph).or. EMPTY(jzdh).or. EMPTY(xmph).or. EMPTY(mpph).or. EMPTY(jzrq)
??chr(7)
cmessagetext="资料不全,不予保存!"
ndialogboxtype=0+48+0
ctitlebartext="信息窗口"
nanswer=messagebox(cmessagetext,ndialogboxtype,ctitlebartext)
thisform.pageframe1.page1.pageframe1. .F.
thisform.pageframe1.page1.pageframe1.
thisform.refresh
ELSE
*!*
thisform.pageframe1.page1.pageframe1.page2.一批号1.controlsource=""
*!*
thisform.pageframe1.page1.pageframe1.page2.一接种日期1.controlsource=""
*!*
SELECT fjpb01
*!*
GO TOP
*!*
LOCATE all FOR
一批号=ph
LOCATE all FOR 一批号=ph .and.一接种日期=jzrq
IF EOF()
=tableupdate(.t.)
??chr(7)
cmessagetext="保存成功!"
ndialogboxtype=0+48+0
ctitlebartext="信息窗口"
nanswer=messagebox(cmessagetext,ndialogboxtype,ctitlebartext)
thisform.pageframe1.page1.pageframe1. .T.
thisform.pageframe1.page1.pageframe1. .F.
thisform.pageframe1.page1.pageframe1. .F.
xgbz=.F.
thisform.refresh
ELSE
??chr(7)
cmessagetext="记录重复(批号和接种日期同时相同),不予保存!"
ndialogboxtype=0+48+0
ctitlebartext="信息窗口"
nanswer=messagebox(cmessagetext,ndialogboxtype,ctitlebartext)
delete
pack
thisform.pageframe1.page1.pageframe1. .T.
thisform.pageframe1.page1.pageframe1. .F.
thisform.pageframe1.page1.pageframe1. .F.
go bottom
xgbz=.F.
thisform.refresh
endif
endif
case
nanswer=7
=tablerevert(.T.)
*!*
对行缓冲区中的记录还原,即还原成空白
??chr(7)
cmessagetext="放弃添加新记录成功!"
ndialogboxtype=0+48+0
ctitlebartext="信息窗口"
nanswer=messagebox(cmessagetext,ndialogboxtype,ctitlebartext)
thisform.pageframe1.page1.pageframe1. .T.
thisform.pageframe1.page1.pageframe1. .F.
thisform.pageframe1.page1.pageframe1. .F.
go bottom
xgbz=.F.
thisform.refresh
endcase
表中并无重复记录,但保存成功哪些语句无用,直接就报 cmessagetext="记录重复(批号和接种日期同时相同),不予保存!请求高手帮助,谢谢!