主题:版主求救,
*保存
getid=alltrim(thisform.txtid.VALUE)
getzkZh=alltrim(thisform.txtzkzh.VALUE)
getNAME=alltrim(thisform.txtname.VALUE)
GETSFZHM=ALLTRIM(THISFORM.TXTsfzhm.VALUE)
GETXB=ALLTRIM(THISFORM.OPTIONGROUP1.VALUE)
GETCSNY=THISFORM.TXTcsny.VALUE
GETMC=ALLTRIM(THISFORM.TXTnation.VALUE)
GETBYXX=ALLTRIM(THISFORM.TXTbyxx.VALUE)
GETRXCJ=THISFORM.TXTrxcj.VALUE
GETYDLX=ALLTRIM(THISFORM.COMBO1.VALUE)
GETJDXX=ALLTRIM(THISFORM.TXTjdxx.VALUE)
GETBZ=ALLTRIM(THISFORM.EDTbz.VALUE)
use student exclusive
IF EMPT(GETID)
MESSAGEBOX("学号名不能为空",48,"错误")
goto bottom
delete
pack
goto bottom
thisform.txtid.setfocus()
else
set order to id
SEEK getID
IF !FOUND()
messagebox("添加完毕",48,"操作成功")
else
set multilocks on
=cursorsetprop("buffering",5)
tableupdate(.t.)
messagebox("学号重复",48,"错误")
thisform.txtid.setfocus()
ENDIF
endif
Thisform.txtid.enabled=.f.
Thisform.txtzkzh.enabled=.f.
Thisform.txtname.enabled=.f.
Thisform.txtsfzhm.enabled=.f.
Thisform.txtcsny.enabled=.f.
Thisform.txtnation.enabled=.f.
Thisform.txtbyxx.enabled=.f.
Thisform.txtrxcj.enabled=.f.
thisform.txtjdxx.enabled=.f.
Thisform.EDTbz.enabled=.f.
Thisform.combo1.enabled=.f.
Thisform.optiongroup1.enabled=.f.
thisform.TXTid.SETFOCUS
thisform.command1.enabled=.t.
thisform.command2.enabled=.t.
thisform.command4.enabled=.t.
thisform.command5.enabled=.t.
thisform.command3.enabled=.f.
帮我看看,为什么第一次显示,第二次显示"操作成功",第三次是"错误",第四次"操作成功",这样循环,但数据可以保存,也不检查重复数据,
getid=alltrim(thisform.txtid.VALUE)
getzkZh=alltrim(thisform.txtzkzh.VALUE)
getNAME=alltrim(thisform.txtname.VALUE)
GETSFZHM=ALLTRIM(THISFORM.TXTsfzhm.VALUE)
GETXB=ALLTRIM(THISFORM.OPTIONGROUP1.VALUE)
GETCSNY=THISFORM.TXTcsny.VALUE
GETMC=ALLTRIM(THISFORM.TXTnation.VALUE)
GETBYXX=ALLTRIM(THISFORM.TXTbyxx.VALUE)
GETRXCJ=THISFORM.TXTrxcj.VALUE
GETYDLX=ALLTRIM(THISFORM.COMBO1.VALUE)
GETJDXX=ALLTRIM(THISFORM.TXTjdxx.VALUE)
GETBZ=ALLTRIM(THISFORM.EDTbz.VALUE)
use student exclusive
IF EMPT(GETID)
MESSAGEBOX("学号名不能为空",48,"错误")
goto bottom
delete
pack
goto bottom
thisform.txtid.setfocus()
else
set order to id
SEEK getID
IF !FOUND()
messagebox("添加完毕",48,"操作成功")
else
set multilocks on
=cursorsetprop("buffering",5)
tableupdate(.t.)
messagebox("学号重复",48,"错误")
thisform.txtid.setfocus()
ENDIF
endif
Thisform.txtid.enabled=.f.
Thisform.txtzkzh.enabled=.f.
Thisform.txtname.enabled=.f.
Thisform.txtsfzhm.enabled=.f.
Thisform.txtcsny.enabled=.f.
Thisform.txtnation.enabled=.f.
Thisform.txtbyxx.enabled=.f.
Thisform.txtrxcj.enabled=.f.
thisform.txtjdxx.enabled=.f.
Thisform.EDTbz.enabled=.f.
Thisform.combo1.enabled=.f.
Thisform.optiongroup1.enabled=.f.
thisform.TXTid.SETFOCUS
thisform.command1.enabled=.t.
thisform.command2.enabled=.t.
thisform.command4.enabled=.t.
thisform.command5.enabled=.t.
thisform.command3.enabled=.f.
帮我看看,为什么第一次显示,第二次显示"操作成功",第三次是"错误",第四次"操作成功",这样循环,但数据可以保存,也不检查重复数据,