combo1,combo2的值是>,>=,<=,<,=
combo3的值是and,ortext1,text2的值直接输入根据combo1,combo2,combo3所的值,进行text1,text2值的条件判断本人公式如下:(此公式无法执行)
if text1.text & combo1.text & 100 & combo3.text & text2.text & combo2.text & 200 then
end if请问该怎么做,谢谢!公式等同于:if 120>100 and  50 <200 thenend if
 

解决方案 »

  1.   

    我觉得可能是and的左右缺少空格的原因
    text1.text & combo1.text & 100 & combo3.text & text2.text & combo2.text & 200
    改成 text1.text & combo1.text & 100 & " " & combo3.text & " " & text2.text & combo2.text & 200 试试
      

  2.   

    text1.text & combo1.text & 100 & combo3.text & text2.text & combo2.text & 200 
    会认为是
    "120>100 and  50 <200 "
    这里是vb不是的dephi
    你只能自己判断 combo1.text 写死不能写活
      

  3.   

    combo1值是>,>=,<=,<,=text1,text2的值直接输入公式如下:(此公式无法执行,提示“类型不匹配")if text1.text & combo1.text & text2.text  then
    end if公式等同于:if 120>100 thenend if
    请问该怎么做,谢谢!
      

  4.   

    dim re as booleanselect case combo1 & combo2 & combo3
       case ">and<"
         re=(val(text1) >100 and  val(text2) <200)
       case "<=or>"
         re=(val(text1) <=100 or  val(text2)>200)
       case ...
        ...
    end selectif re then
       ...
    end if
      

  5.   

    看来只能用select case 了