RnRExpress
Technical User
I have this code which I did to convert Callphone ESN's in Hex to Decimal.
Private Sub Hex2Dec_Click()
left2 = Left([Customer ESN Hex], 2)
right6 = Right([Customer ESN Hex], 6)
dleft = "&H" & left2
dright = "&H" & right6
valleft = Val(dleft)
valright = Val(dright)
dec_number = "0" & valleft & valright
Me.[Customer ESN] = dec_number
End Sub
Valright needs to always be 8 digits. But sometimes the calculation results have a leading "0", (i.e. 01234567) When that happens, the dec_number result is off by a number because valright shows 1234567 instead of 01234567.
Is there any way I can set this up so valright always is 8 digits and if the first number is a 0, then it still will display the 0 and not drop it?
Thanks in advance!!
Richard
Private Sub Hex2Dec_Click()
left2 = Left([Customer ESN Hex], 2)
right6 = Right([Customer ESN Hex], 6)
dleft = "&H" & left2
dright = "&H" & right6
valleft = Val(dleft)
valright = Val(dright)
dec_number = "0" & valleft & valright
Me.[Customer ESN] = dec_number
End Sub
Valright needs to always be 8 digits. But sometimes the calculation results have a leading "0", (i.e. 01234567) When that happens, the dec_number result is off by a number because valright shows 1234567 instead of 01234567.
Is there any way I can set this up so valright always is 8 digits and if the first number is a 0, then it still will display the 0 and not drop it?
Thanks in advance!!
Richard