autonumber format property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello ppl...
is there any way to transform an autonumber in a special format...
for example AEW-???...where AEW is a stable text and the ??? random numbers
with a specific lenght?
i cant find something like that in the Access s choices.
 
vassilis,
Since PK autonumbers should never be accessed, or even seen by the user,
you can create a calculated text control on your form with a ControlSource
of...
= "AEW-" & [YourAutonumberFieldName]

You wrote...
with a specific lenght?
Autonumbers are not a specific length. Why would you want to take something
like the frirst 3 digits of an autonumber in your string?
If you used...
= "AEW-" & Left([YourAutonumberFieldName], 3)
then 1234 and 12345 would both display AEW-123.
 
vassilis said:
hello ppl...
is there any way to transform an autonumber in a special format...
for example AEW-???...where AEW is a stable text and the ??? random
numbers with a specific lenght?
i cant find something like that in the Access s choices.

I suggest you may not want to use Autonumber for that use. Autonumbers are
designed to provide unique numbers. It in not designed to provide numbers
in order and for a number of reasons may not do so. As a result using them
in any application where the user sees the numbers is likely to end up with
confusion.

There are other ways of providing the numbers you want depending on the
particual application.
 
thanks..its working as i want , but these autotext values from the form does
not appear in the original talble column...did i miss anything?

Al Camp said:
vassilis,
Since PK autonumbers should never be accessed, or even seen by the user,
you can create a calculated text control on your form with a ControlSource
of...
= "AEW-" & [YourAutonumberFieldName]

You wrote...
with a specific lenght?
Autonumbers are not a specific length. Why would you want to take something
like the frirst 3 digits of an autonumber in your string?
If you used...
= "AEW-" & Left([YourAutonumberFieldName], 3)
then 1234 and 12345 would both display AEW-123.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


vassilis said:
hello ppl...
is there any way to transform an autonumber in a special format...
for example AEW-???...where AEW is a stable text and the ??? random
numbers
with a specific lenght?
i cant find something like that in the Access s choices.
 
vassilis said:
thanks..its working as i want , but these autotext values from the
form does not appear in the original talble column...did i miss
anything?

It doesn't need to be in the table. Just use that expression wherever you need
it. If you don't want to re-write the expression multiple times, put it in a
query based on your table and use that query every place you would otherwise
have used the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top