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

Autonumber field that includes a preface

Status
Not open for further replies.

wz

Programmer
Feb 16, 2001
88
US
I would like to have an autonumber field that includes a preface like:


cc01
cc02

the "cc" would appear before each auto number 01, etc. Is this possible?

This would be soooo helpful for use in a multi-person entering setup...
 
not exactly ... but you can come close by concatening the prefix (from a seperate field) with the autonumber. As in

usr = "cc"
OttoNumber = 3
PseudoAuto = usr & Format(OttoNumber, "00000000")
? Usr
cc
? OttoNumber
3
? PseudoAuto
cc00000003


MichaelRed


 
Let’s say you want an autonumbered field by Microsoft but want some characters in front of the number like mc001, mc002, etc. Go to design view, click on the autonumber field and in the Format box type “mc”00
This places mc next to 2 zeros and then tacks on the autonumber.
 
Did I miss read your post? Do you want the users initials before the autonumber, not just "cc"? Then you would just store the initials in a separate field and not concatenate with the autonumber of the field. That would be a calculated field and you do not store calculated fields. You would combine them in a query, form, report.
 
thanks to both!

In the table I typed "cc" in the format of the field but did not place the 00 next to it - thanks for the help it works now the way I want it too!

concatening - will be also something I use in another table :)

wz

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top