Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I'm Chinese,English so poorly,I hope someone can know my question
The form have a input box (we can input two nums),and have a btn,we can use btn search the data from chart,and data is expression statistics .the expression is
if(rzxxcs <> '' and rzsxcs <> '',
if(Count (??ID) >= rzxxcs and count(??ID)<= rzsxcs,count(??ID)),
if(rzxxcs = '' and rzsxcs <> '',
if(count(??ID)<= rzsxcs,count(??ID)),
if(rzsxcs = '' and rzxxcs <> '',
if(Count (??ID) >= rzxxcs ,count(??ID)),
count(??ID)
)
)
)
How do it use vb script actions?
My plan:
1.define fourvariables : NUM_SX,NUM_XX,rzxxcs,rzsxcs
2.define the variables NUM_SX,NUM_XX to Input boxs
3.vb script action
' Create By KanGwei in 2010/10/26
' get the value of variable
function getVarValue(p_varname)
getVarValue=activeDocument.variables(p_varname).getContent.string
end function
' set the value to variable
sub setVarValue(p_varname,p_varvalue)
dim d_var
Set d_var=ActiveDocument.Variables(p_varname)
d_var.setContent p_varvalue,true
end sub
' Search action
sub s_dosearch
dim d_sx,d_xx
d_sx = getVarValue("NUM_SX")
d_xx = getVarValue("NUM_XX")
' ???? ?? ???? Error info
if d_sx < d_xx then
msgbox "????????????"
' All Passed?Do Search
elseif d_sx >= d_xx then
call setVarValue("rzxxcs" ,d_xx)
call setVarValue("rzsxcs" ,d_sx)
end if
end sub
Thanks!!!
My Msn:willking6517@live.cn
No body can answer me[:'(]
No body can answer me[:'(]
Why you need variables to define search criteria ? Can you explain the purpose of the expression ?