可以这样解:
大类有一个表:
id name desc stat
01 空调 (国产)
中类有一个表:
id name desc stat
0101 分体 (国产)
0102 柜式 (国产)
小类有一个表
id name desc stat
0101001 一批单体 (国产)
0101002 1.5批单体 (国产)
维护小类表时:
大类做一下拉数据窗口 :
中类做一下拉数据窗口:(在 rowfocuschanged 事件中编写: child1.setfilter(mid(id,1,2))=''大类‘’)
ls_deptid = data
String dalei,dete
//判断窗口上的值是否和数据库一致
if ls_deptid=dete and ls_deptid<>"" then
//根据ls_deptid来查询类型
select gmaxdesc into:dalei from goods_max where gmaxid=:ls_deptid;
//将数据库的值赋予窗口上
ls_deptid=dalei
messagebox("系统提示","进入dalei的值是"+dalei)
return 0
else
select gmaxdesc into:dalei from goods_max where gmaxid=:ls_deptid;
ls_deptid=dalei
this.SetItem(row,"gmaxid",ls_deptid)
return 1
end if
else
end if
但是出现了一个新的问题 但我选取了值之后 要点击状态下值才能改变下拉框的值