表单初始化时,先把省份添加上
程序代码:
use sysitemxzqhf
sfcc=alltrim(sf)
thisform.text7.additem(alltrim('河南省'))
scan for alltrim(sf)#'河南省'
if sfcc#alltrim(sf)
thisform.text7.additem(alltrim(sf))
sfcc=alltrim(sf)
endif
endscan
use
text7是省;text8是市;text9是县
***********************************
text7.interactivechange写如下代码:
thisform.text8.clear
thisform.text9.clear
use sysitemxzqhf
dscc=''
set filter to alltrim(sf)==alltrim(thisform.text7.displayvalue)
go top
scan for alltrim(ds) # alltrim(thisform.text7.displayvalue) .or. (right(alltrim(sf),2)=='市')
if dscc#alltrim(ds)
thisform.text8.additem(alltrim(ds))
dscc=alltrim(ds)
endif
endscan
set filter to
use
thisform.text8.setfocus
thisform.refresh
***********************************
text8.interactivechange写如下代码:
thisform.text9.clear
use sysitemxzqhf
dscc=''
set filter to alltrim(sf)==alltrim(thisform.text7.displayvalue) .and. alltrim(ds)==alltrim(thisform.text8.displayvalue)
go top
scan
if alltrim(xq) == alltrim(thisform.text8.displayvalue)
thisform.text9.additem('市区')
else
thisform.text9.additem(alltrim(xq))
endif
endscan
set filter to
use
thisform.text9.setfocus
thisform.refresh