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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add 3 leading zeros to field if only 5 of 8 are input?

Status
Not open for further replies.

ImJay

Technical User
Apr 12, 2005
12
US
I need to set up my form so that the Work Order and Work Request fields can be linked back to Passport (yucky database). In Passport these fields contain 8 digits.

If the work order or work request is initiated from a standing preventive maintenance requirement, there are eight effective digits.

If, instead, the work is a modification, correction or "broke-fix," there are five effective digits and three leading zeros.

When people enter these numbers, they tend to ignore the leading zeros. Is there some way for me to add the leading zeros automatically if only five digits are entered?

Thanks,

Imjay

 
I have added leading zeros with the following:

Right("00000000"&[Field],8)

You could put the code in the after update event. This assumes that your field is stored as text rather than a number. The leading zeros won't save in a number field.

You could also use an input mask with leading zeros and have them saved. Again only works in text fields.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top