请帮助查找表单存在的问题
想建一个查询及修改表单。查询按钮的CLICK代码:
if empty(thisform.Text1.value)=.f.
go top
a=
b=alltrim(thisform.Text1.value)
c=.f.
if a="身份证号"
locate for 身份证号=b
if eof()
messagebox("数据库中不存在您所要查询的记录",16,"系统提示")
go top
return
else
c=.t.
endif
ENDIF
if a="姓名"
locate for 姓名=b
if eof()
messagebox("数据库中不存在您所要查询的记录",16,"系统提示")
go top
return
else
c=.t.
endif
ENDIF
if a="联系电话"
locate for 联系电话=b
if eof()
messagebox("数据库中不存在您所要查询的记录",16,"系统提示")
go top
return
else
c=.t.
endif
ENDIF
if c
thisform.Text1.enabled=.f.
go recno()
thisform.Text2.visible=.t.
thisform.Text2.enabled=.f.
thisform.Text3.visible=.t.
thisform.Text4.visible=.t.
thisform.Text5.visible=.t.
thisform.Text6.visible=.t.
thisform.Text7.visible=.t.
thisform.Text8.visible=.t.
thisform.Text9.visible=.t.
thisform.Text10.visible=.t.
thisform.Text11.visible=.t.
thisform.Text12.visible=.t.
thisform.Text13.visible=.t.
thisform.Text14.visible=.t.
thisform.Text15.visible=.t.
thisform.Text16.visible=.t.
thisform.Label3.visible=.t.
thisform.label4.visible=.t.
thisform.Label5.visible=.t.
thisform.Text2.value=jg.序号
thisform.Text3.value=jg.批文文号
thisform.Text4.value=jg.姓名
thisform.Text5.value=jg.出生日期
thisform.Text6.visible=jg.身份证号
thisform.Text7.visible=jg.派出所
thisform.Text8.visible=jg.村委
thisform.Text9.visible=jg.联系电话
thisform.Text10.visible=jg.案件性质
thisform.Text11.visible=jg.刑期
thisform.Text12.visible=jg.期限
thisform.Text13.visible=jg.种类
thisform.Text14.visible=jg.开始时间
thisform.Text15.visible=jg.结束时间
thisform.Text16.visible=jg.接收民警
thisform.Label3.visible=.t.
thisform.label4.visible=.t.
thisform.Label5.visible=.t.
thisform.grid1.setfocus
this.enabled=.f.
endif
else
messagebox("请输入要查找的内容!",16,"系统提示")
thisform.Text1.value=""
thisform.Text1.Setfocus
endif
thisform.refresh
修改按钮的CLICK代码:
a=alltrim(thisform.Text3.value)
b=alltrim(thisform.Text4.value)
if empty(a).or.empty(b)
messagebox("姓名及批文文号不可以修改为空值",16,"系统提示")
return
endif
msg=messagebox('确定要修改记录吗?',32+4,'系统提示')
if msg=6
go recno()
replace jg.批文文号 with a,jg.姓名 with b
messagebox("修改记录成功",16,"系统提示")
thisform.grid1.refresh
thisform.Text1.enabled=.t.
this.enabled=.f.
thisform.Text2.visible=.f.
thisform.Text3.visible=.f.
thisform.Text4.visible=.f.
thisform.Label3.visible=.f.
thisform.label4.visible=.f.
thisform.Label5.visible=.f.
thisform.Text1.value=""
thisform.Text1.setfocus
endif
点查询按钮,提示:此属性的数据类型无效。
修改按钮代码未写完,能否按这个模式写下去。
谢谢