主题:请教,我的"保存"按钮一按,一直显示"学号重复"
*保存
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,"错误")
pack
thisform.txtid.setfocus()
return
else
set order to id
SEEK getID
IF !FOUND()
tableupdate(.t.)
messagebox("添加完毕",48,"操作成功")
else
messagebox("学号重复",48,"错误")
thisform.txtid.setfocus()
return
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,"错误")
pack
thisform.txtid.setfocus()
return
else
set order to id
SEEK getID
IF !FOUND()
tableupdate(.t.)
messagebox("添加完毕",48,"操作成功")
else
messagebox("学号重复",48,"错误")
thisform.txtid.setfocus()
return
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.
这是源代码,我的"保存"按钮一按,一直显示"学号重复",但是数据能保存上,而且能重复保存.