Autonumber Field

S

Secret Squirrel

Is there any way to have an autonumber field include text as well as numbers?
The reason I ask is because I am trying to have the autonumber include a
prefix letter before it. Can this be done?
 
6

'69 Camaro

Is there any way to have an autonumber field include text as well as
numbers?

No. An AutoNumber field will increment the seed by one to get the next
number to assign the next new record (unless you're using an increment other
than the default or a non-incrementing AutoNumber).
I am trying to have the autonumber include a
prefix letter before it. Can this be done?

Use two fields to calculate the value in a query or in VBA. For example:

SELECT (Prefix & ID) AS Ident
FROM tblMyTable;

Or in VBA:

Me!txtIdent.Value = Me!txtPrefix.Value & Me!txtID.Value

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
J

John Vinson

Is there any way to have an autonumber field include text as well as numbers?
The reason I ask is because I am trying to have the autonumber include a
prefix letter before it. Can this be done?

In addition to Gunney's suggestion - if the prefix letter is always
the same, simply use the field's Format property to include it; a
format of

"A000000"

will display the numbers like A001285.

Note that Autonumbers are not really suitable for human-readable
identifiers; they'll always have gaps, and can become random.

John W. Vinson[MVP]
 
Top