Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / May 2005

Tip: Looking for answers? Try searching our database.

Limit Auto Number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nathan a - 26 May 2005 16:21 GMT
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.
Ken Snell [MVP] - 26 May 2005 16:46 GMT
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.
Signature


       Ken Snell
<MS ACCESS MVP>

> 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.
nathan a - 26 May 2005 17:09 GMT
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.

> No. It then would not be a unique number within the database.
>
[quoted text clipped - 5 lines]
> > Or
> > can I format to only 3 places.
Ken Snell [MVP] - 26 May 2005 18:03 GMT
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.
Signature


       Ken Snell
<MS ACCESS MVP>

> Is there a way to program and autoumber field?  I am thinking in the
> default
[quoted text clipped - 11 lines]
>> > Or
>> > can I format to only 3 places.
nathan a - 26 May 2005 19:42 GMT
Thanks for your help.  I also came to this solution.

> 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
[quoted text clipped - 19 lines]
> >> > Or
> >> > can I format to only 3 places.
Josh Nankivel - 26 May 2005 17:57 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.