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

auto number (letters-YY0001)

Status
Not open for further replies.

wshs

Programmer
Nov 22, 2005
220
US
i've created a new field "txtprNum"
this number needs to be in a such format; whs-yy0001
so whs- is always the same and then yy = this year (05)and needs to change to (06) next year, and then 0001 + 1 everytime new record is added.
is this possible in vba?
so when user opens a form, this field is automatically given a number. first it'll be whs-050001.
and then when you add another record, it'll be whs-050002.
im sure there is a way to do this on form open event.. or else.. any help will be appreciated..
 
Provided you'll not have several users creating records at the same time you may consider the DMax function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thx but i don't understand...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top