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!

Alpha-Numeric Number Sequence, not auto

Status
Not open for further replies.

Smack

Technical User
Apr 20, 2001
261
US
I'm setting up a new mdb, and I need to assign record numbers. I need to know how to format a number that will show something like RD02045,and the next new record to be RD02046
I found this from Lonnie Johnson in a thread,
Or you can set the default value of this field on your form using the DMax function and increment by 1 like so:

= DMax ("[YourFieldName]","YourTableName") + 1
Will this work
Can I set up a text field this way?
-Smack
 
Yes, use the above code for a number primary key in combination with putting >"RDO" in the format property of the primary key in the table.

This will increment the numbers (2000, 2001, 2002, 2003, etc.), but show them like this:

RDO2000, RDO2001, RD2002, etc.

If you want the number to show as 0202 (leading zero(s)), then you will need to make the PK a text field instead of a number. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top