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

preceding zero's

Status
Not open for further replies.

Ouch

Programmer
Jul 17, 2001
159
GB


help

i have a id code that is generated from three difrent feilds

the first field is long interger and reads 0039
the second field is a year and reads 2003
the third field is a autonumber 268

when i join the fields in the query to get my id number it looses the preceding zeros.

these are very important

it gives this
39_2003_268

and i need this
0039_2003_268

any idea's
 
Assuming the fields are called Fld1, Fld2, and Fld3, then use the following expression:

ConcatFld = format(Fld1, "0000") & _
format(Fld2, "_0000") & _
format(Fld3, "_000")

These will retain any leading zeros, as well as embed the underscore characters as required.
Hope this helps,
Steve
 
Not only a multi post - Thwack.

but also - how does this relate to Tables & Relationships ?


thread701-306013
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top