*Solved* Problems keeping leading zeros
Hello all,
I have a problem trying to keep leading zeros.
The entries in a text box can be numbers or text, and are not of a fixed length.
I want to store the entry into a string variable, which ultimately gets used in a SQL INSERT statement (into a string field).
The problem is, I can't find a way to keep the leading zeros.
For example, if somebody enters "000000" the variable will store it as "000000", but when that variable is used in the SQL statement it becomes "0".
I've tried playing around with Cstr(strVariable) but that doesn't work.
I've also played with IsNumeric(strVariable) logic but that doesn't work either (I'm surmising there is a difference between being a number, and being numeric...).
Any help on this one would be very much appreciated.
Hello all,
I have a problem trying to keep leading zeros.
The entries in a text box can be numbers or text, and are not of a fixed length.
I want to store the entry into a string variable, which ultimately gets used in a SQL INSERT statement (into a string field).
The problem is, I can't find a way to keep the leading zeros.
For example, if somebody enters "000000" the variable will store it as "000000", but when that variable is used in the SQL statement it becomes "0".
I've tried playing around with Cstr(strVariable) but that doesn't work.
I've also played with IsNumeric(strVariable) logic but that doesn't work either (I'm surmising there is a difference between being a number, and being numeric...).
Any help on this one would be very much appreciated.
Last edited: