i have an old string say oldString="abc-2"
i want to change it to "abc-3"
so i did this
myArray = Split(oldString, "-")
oldP = myArray(UBound(myArray))
myArray(UBound(myArray))= Str(val(oldP) + 1)
newString=join(myArray,"-")
why do I get the wrong number??
and if i try to use Cint()
, then i got Error.
please help...
just found the real problem. I changed my input mode by accident and put a "Double-byte" number 2 into the same Field ,where i got my oldstring, of another Record. And after that CInt recognize my oldstring as wrong type. It seems that ms-Access changed the encode of that field implicitly, so that Cint do not know what to do and Val get the wrong value. They should have made Textfield in Access, String functions all encoding independent, or all use UTF-8. At least it should warn me when it change the encode of that textfield. Maybe i Should report it to MS?