Unique IDs

  • Thread starter Thread starter ggonella
  • Start date Start date
G

ggonella

Hi,
I was wondering if it was possible to create an ID with a prefix and a
sequential number. I would like the prefix to always be the same to
letters and look like this:
IA-1
IA-2
IA-3
and so on.
Thanks in advance,
Garrett
 
Garrett,
Whatever method you're using to generate unique numbers, keep that a separate field
(ex. RecID)
Use an unbound calculated field to "display" your "custom" ID (ex. SeqID)
= "IA-" & [RecID]
Continue to use RecID as the unique key value for relationships, lookups, etc...

Since SeqIDs will all have LAxxxx format, there's no need to save that value to a
field. You can use that same method to display the SeqID on any subsequent query, form,
or report, on the fly.
 
Create an autonumber field in your table [Auto]. Create a text field in your
table [Text].

Create a query and add a column like this
Something:[TableName![Auto]&"-"&[TableName]![Text]

Hope this helps
 
Hi Al

You are of course correct -

but I take the liberty of changing the question as I can't really the point
in haveing the "same" prefix all the time. In this case you could just use
an autonumber which is why I suggested using another field [text] so it could
be altered for different uses.

But yours is the better answer


--
Wayne
Manchester, England.
Enjoy whatever it is you do


Al Campagna said:
Garrett,
Whatever method you're using to generate unique numbers, keep that a separate field
(ex. RecID)
Use an unbound calculated field to "display" your "custom" ID (ex. SeqID)
= "IA-" & [RecID]
Continue to use RecID as the unique key value for relationships, lookups, etc...

Since SeqIDs will all have LAxxxx format, there's no need to save that value to a
field. You can use that same method to display the SeqID on any subsequent query, form,
or report, on the fly.

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Hi,
I was wondering if it was possible to create an ID with a prefix and a
sequential number. I would like the prefix to always be the same to
letters and look like this:
IA-1
IA-2
IA-3
and so on.
Thanks in advance,
Garrett
 
Back
Top