PPC 2003, adding zeros to a text box
Posted on 2007-08-02
I have a text box that keeps taking off the first digit if it is a zero, so I want to make sure one or more is added to fix this problem. The field is 8 digits long so I would need to fill in one or more zeros to make it to that length, but I can't seem to figure out how to do it using eVB 3.0.
Here is what I thought:
If txtAWB1.Text.length < 8 Then
txtAWB1.Text = txtRefNum.Text.PadLeft(8, "0")
But length is not accepted, I tried len as well, but I must be something wrong. Please help with fixing the code or telling me how I can stop the first digit(s) if it is zero from being dropped off.
Thanks in advance the assistance in this matter.