请教多表表单设计问题
在“查询”按纽的Click事件中添加代码如下:
PUBLIC qydm
qydm=ALLTRIM(thisform.container1.text1.Value)
SELECT qyjbxxb
LOCATE FOR ALLTRIM(qyjbxxb.jgdm)=qydm
IF FOUND()
WITH thisform
.
.container1.text1.enabled=.F.
.command1.enabled=.T.
.command2.enabled=.T.
.command3.enabled=.T.
ENDWITH
WITH thisform.container2
.text1.value=jgdm
.text2.value=jgmc
.text3.value=jgdz
.text4.value=dhhm
.text5.value=yzbm
.text6.value=emall
.text7.value=url
.text8.value=xzqh
.text9.value=jjlx
.text10.value=jglx
.text11.value=jjhy
.text12.value=zch
.text13.value=jyqx
.text14.value=fddbr
.text15.value=sfzhm
.text16.value=yddhhm
.text17.value=zgrs
.text18.value=ncz
.text19.value=djrq
.text20.value=fsrq
.text21.value=khyh
.text22.value=yhzh
.text23.value=bzhgljg
.text24.value=bzhglry
.text25.value=brdhhm
.edit1.value=jyfw
ENDWITH
SELECT qyzycpk
LOCATE FOR ALLTRIM(qyzycpk.jgdm)=qydm
IF FOUND()
WITH thisform.container2.grid1
.column1.header1.caption='产品名称'
.column2.header1.caption='执行标准编号'
.column3.header1.caption='执行标准名称'
.column4.header1.caption='标准等级'
.column5.header1.caption='是否采标'
.column6.header1.caption='获奖名称'
.column7.header1.caption='获奖时间'
.column8.header1.caption='有效期限'
.column9.header1.caption='许可类型'
.column10.header1.caption='许可证号'
.column11.header1.caption='获证时间'
.column12.header1.caption='许可期限'
.column1.text1.value=zycp
.column2.text1.value=cpbzdh
.column3.text1.value=cpbzmc
.column4.text1.value=cpbzdj
.column5.text1.value=cbbz
.column6.text1.value=hjmc
.column7.text1.value=hjsj
.column8.text1.value=yxqx
.column9.text1.value=xklx
.column10.text1.value=xkzh
.column11.text1.value=xksj
.column12.text1.value=xkqx
ENDWITH
thisform.container2.grid1.refresh
ELSE
MESSAGEBOX('该企业尚未登记任何产品')
ENDIF
ELSE
MESSAGEBOX('尚未登记该企业的任何信息,请重新输入企业代码!',0,'提示')
thisform.container1.text1.value=''
thisform.container1.text1.SetFocus
ENDIF
运行结果:表格中不能显示“qyzycpk”(企业主要产品数据表)中的相应记录。
请各位老师帮忙检查一下,问题出现在哪里?