number Format

mr moe

Registered User.
Local time
Today, 21:28
Joined
Jul 24, 2003
Messages
332
I have a field that is formated to 6 digits length example 123456 some numbers in the table are five digits length example 12345, how can I make 12345 look like 012345 my idea is to insert a zero for all numbers that are five digits length, but I need to do this in VB anybody can help. Thanks guys.
 
Format(YourNumber, "000000")
 
Thanks for the fast reply.
I tried that but its still not working. Here is the way I have done it.
myfieldname = format(myfieldname,"000000")
This is still displaying it as for ex 12345 and not 012345. What do you suggest?
 
If LEN([Field]) = 5 then
[Field] = '0' & [Field]
end if

nb field type must be a string
 
crosmill said:
nb field type must be a string

You can factor that in:

Code:
If Len(CStr([Field])) = 5 Then
    [Field] = "0" & [Field]
End If
 

Users who are viewing this thread

Back
Top Bottom