跳至主內容

搜尋

搜尋

VBScript - Cannot add values?

評論

2 條評論

  • Avatar
    Peter Thane

    Although the values are numeric the VB is thinking they are text and so is concatenating the fields together. If you add CInt(......) to both strings then that will then work

    ie Value = CInt(Format.NamedSubStrings("TotalOrder").Value) + CInt(Field....<etc>....)

    0
  • Avatar
    Patryk Gawrysiak

    Thanks Peter Thane, 

    I used your method and ran into an overflow error, however I fixed it by using 'CLng' instead of 'CInt'

    Thanks Again.

    0

登入寫評論。