Home > database >  In dw itemchanged events through the if statement judgment to a field assignment, cannot achieve
In dw itemchanged events through the if statement judgment to a field assignment, cannot achieve

Time:09-15

In order to realize the function: in a list, select "this county" is to assign a value "address 1", if choose "other counties in the city" the assignment "address 2"
Code: CHOOSE CASE dwo. Name
CASE 'CSRQ'
Ldt_csrq=enclosing Object. CSRQ [row]
Ll_nl=Year (Date (ldt_rq)) - Year (Date (ldt_csrq))
Enclosing Object. SZNL [row]=String (ll_nl)
CASE 'brsy'
Ls_brsy=enclosing Object. Brsy [row]
If ls_brsy='the counties' then///
Enclosing Object. XZZS [row]='1' in sichuan
Elseif ls_brsy='other counties in the city then
Enclosing Object. XZZS [row]='2' in sichuan
End the if
The end choose
Question: can't I choose this county assignment 1, first choose this county, in choosing other counties in the city, is assigned a value of 1, that is to say, is shown in a choice of data,

CodePudding user response:

Your code should be written in itemchanged event, if the value of the current industry forefront, you directly use the data of this parameter,
If use ls_brsy=This. Object. Brsy (row), is the last value, because the input data is not accepttext

Change the code to the

CHOOSE a CASE dwo. Name
CASE 'CSRQ'
Ldt_csrq=enclosing Object. CSRQ [row]
Ll_nl=Year (Date (ldt_rq)) - Year (Date (ldt_csrq))
Enclosing Object. SZNL [row]=String (ll_nl)
CASE 'brsy'
Ls_brsy= data ////This. Object. Brsy (row)
If ls_brsy='the counties' then///
Enclosing Object. XZZS [row]='1' in sichuan
Elseif ls_brsy='other counties in the city then
Enclosing Object. XZZS [row]='2' in sichuan
End the if
The end choose

CodePudding user response:

With the method of the upstairs
Or use the data
Either accepttext once
  • Related