ACCESS的
修改一条数据conn.Execute "update biao1 set kucun = " & Text7 & " where numbel2 = " & Text10 & ""
本来这是可以的现在要改成
conn.Execute "update biao1 set kucun = " & Val(Text7) - Val(Label6) & " where numbel2 = " & Text10 & ""为什么说表达式不对啊 就是 Val(Text7) - Val(Label6)
应该怎么写啊 谢谢大家

解决方案 »

  1.   

    strP=cstr(val(text7)-val(label6))
    conn.Execute "update biao1 set kucun = " & strP & " where numbel2 = " & Text10 & ""
      

  2.   

    conn.Execute "update biao1 set kucun = " & Val(Text7.text) &" - "& Val(Label6.caption) & " where numbel2 = " & Text10 & ""
      

  3.   

    不行 
    标准表达式中数据类型不匹配  SOS
      

  4.   

    conn.Execute "update biao1 set kucun = '" & Val(Text7) - Val(Label6) & "' where numbel2 = '" & Text10 & "'"
      

  5.   

    现在要改成
    conn.Execute "update biao1 set kucun = " & CStr(Val(Text7) - Val(Label6)) & " where numbel2 = " & Text10