"Dean" <d@coveyaccounting.com> wrote in
news:1142207618.275465.42360@j52g2000cwj.googlegro ups.com:
[color=blue]
> Wouldn't that be Me.ID = "P" & NZ(Dmax("ID","TableName"),0)+1
>
> If you want certain number of zeros then you can:
>
> Me.ID = "P" & left$("0000000000" &
> NZ(Dmax("ID","TableName"),0)+1,8)
>
> This would create a 9 character string P00000001, P00000002,
> P00000003, . . . PP00000010, P00000011, etc[/color]
You're missing the point.
First off, you shouldn't mix two pieces of information that are
independently meaningful in a single field.
Second, there are two possibilities:
1. global ID sequence, e.g., P0001, X0002, P0003...
2. ID sequence for each letter, e.g., P0001, X0001, P0002...
The former can be done with an Autonumber field plus a letter field,
while the latter cannot.
My main point is that I'd never store both letter and number in a
single field. If you never actually search on the initial letter,
then why is it there in the first place? If you do, then performance
will be vastly improved by using two fields with a compound unique
index.
--
David W. Fenton
http://www.dfenton.com/
usenet at dfenton dot com
http://www.dfenton.com/DFA/