string to number (1 Viewer)

aliasquark

Registered User.
Local time
Today, 07:40
Joined
Dec 2, 2002
Messages
14
I have a bunch of numbers from a read-only odbc connection which are stored in a field which is defined as being text not number.

In my form I need to use a mask which converts these to 6 digit numbers. i.e 23 becomes 000023.

This works fine when the field is defined as a number, in which case I set the Text Box format for that perticular field as 000000.

However i cannot change the field type to number as it is read only, and whilst it is in text format 000000 doesn't do anything in terms of putting 0's in front of the numbers in question.

please note, it is not a practical solution to import this table to a new one which is then edited (ie changing text to number) as the field values change constantly.

Any tips would be great.


p.s. They need to be in the 000023 format because the numbers are later used in vb codes, so if anyone knows a way of putting the 0's infront of a string value, then this solution would be an acceptable compromise.

Thankyou

Q.
 

Jack Cowley

Registered User.
Local time
Today, 07:40
Joined
Aug 7, 2000
Messages
2,639
Using Format([MyField], "000000") in your code, or wherever, should do the trick.

hth,
Jack
 

Users who are viewing this thread

Top Bottom