Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting leading zero's

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

I am in need of a bit of help with what I'm sure is a very simple issue.

The user has to enter a 3 digit ident number into a table. If the user enter 1 then I want the table to display 001, if they enter 12 then it should display 012 and so on.

As I said, I'm sure this is very easy but I'm havnig a bit of brain rot today!!

Can anyone help?

Thanks,

Woody.
 
I assume the field is bound to a table and is of the type number(N), longinteger(I) or smallinteger(S). In P8 and above, right click the field object, select properties. Go to the format tab. Click the 'Creat New Format' button. Click the Create button, Enter a name for the new format(e.g. 3Digits), set leading zeros to 000.7 (tick 'Make Permanent' if you want this format available to other forms). Set anything else you want - e.g. decimals to 0. Accept and apply the new format.
Caution - I don't think this works on unbound fields because these seem to be always treated as Anytypes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top