if allt(thisform.text1.value)==''
messagebox('名称不能为空!',64,'信息')
thisform.text1.setfocus
retu
endi
sele max(序号) into arra mxh from 数据表 &&找出数据表中存在的最大的序号
sele 数据表
appe blan
repl 序号 with padl(allt(str(val(mxh)+1)),10,'0'),名称 with thisform.text1.value
mxh='' &&数组变量清空
thisform.text1.value='' &&文本框清空
if allt(thisform.text1.value)==''
messagebox('序号不能为空!',64,'信息')
thisform.text1.setfocus
retu
endi
seek thisform.text1.value
if found()
messagebox('该序号已存在!',64,'信息')
thisform.text1.setfocus
retu
endi
if allt(thisform.text2.value)==''
messagebox('名称不能为空!',64,'信息')
thisform.text2.setfocus
retu
endi
appe blan
repl 序号 with thisform.text1.value,名称 with thisform.text2.value