Limit Auto Number

N

nathan a

Is there a way to limit an Auto Number field to 3 places (999) and then start
over at (001). The field size that I am exporting to is only 3 places. Or
can I format to only 3 places.
 
K

Ken Snell [MVP]

No. It then would not be a unique number within the database.

You'll need to create your own numeric field to hold the desired 3-digit
number, and then put correct numbers into that field by code or other means.
 
N

nathan a

Is there a way to program and autoumber field? I am thinking in the default
value I would add 1 to the value of the previous record and set up an IIF
statement to reset it after 999.
 
J

Josh Nankivel via AccessMonster.com

My gut says don't export the autonumber field at all if you've got a
limitation like that. It won't do too much good anyway, and usually when
you are exporting something an autonumber field isn't relevant anyway.
Perhaps if you told us why and what you are exporting it to.

If you must do this, I would say leave your autonumber field alone, and
before you export use a query that adds a calculated field with an iif
statement to keep it between 1 and 999.
 
K

Ken Snell [MVP]

If you just want to export a three-digit number, why not use a calculated
field in a query that takes just the last three numbers from the autonumber
field's value:

My3DigitNumber: Right([AutonumberFieldName], 3)

What you seek to do, as I said before, is not possible with an autonumber
field.
 
N

nathan a

Thanks for your help. I also came to this solution.

Ken Snell said:
If you just want to export a three-digit number, why not use a calculated
field in a query that takes just the last three numbers from the autonumber
field's value:

My3DigitNumber: Right([AutonumberFieldName], 3)

What you seek to do, as I said before, is not possible with an autonumber
field.
--

Ken Snell
<MS ACCESS MVP>

nathan a said:
Is there a way to program and autoumber field? I am thinking in the
default
value I would add 1 to the value of the previous record and set up an IIF
statement to reset it after 999.
 

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

Top