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 / December 2003

Tip: Looking for answers? Try searching our database.

Leading Zeros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamie - 30 Dec 2003 22:02 GMT
Hello anyone,

I would like to show leading zeros on a numeric field
which ideally is auto numbering.

I want to show 0001 and have this increment with the
creation on every new record.

0001
0002
0003

etc....

This may be easy? the last time I did anything like this
was with dbase IV years ago.

Thanks in anticipation.

Jamie
RobFMS - 30 Dec 2003 22:10 GMT
Off the top of my head, I believe you have to specify "00000" in the format
section of the table design.

HTH

Signature

Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

> Hello anyone,
>
[quoted text clipped - 16 lines]
>
> Jamie
- 31 Dec 2003 00:00 GMT
Rob,

Thanks, but ths does not work, any more ideas?

Jamie

>-----Original Message-----
>Off the top of my head, I believe you have to specify "00000" in the format
[quoted text clipped - 24 lines]
>
>.
Cheryl Fischer - 31 Dec 2003 00:31 GMT
Jamie,

You can force your numeric fields to display leading zeros in forms, reports
and queries by using:

    Format([MyNumberField], "0000")  ' which will get you a 4-character
number with leading zeros

However, you cannot store the data in a number field in your table that way.

You can get your number field to increment with the addition of a new record
by making the field an AutoNumber type.  But, be aware that the purpose of
an AutoNumber field is only to provide a record identifier with nearly 100%
guarantee of uniqueness.  There is no guarantee of consecutiveness, as
AutoNumbers are not re-used; deleting a record or starting to create a new
record will leave 'holes' .

If you must have a number-like field in your table which stores leading
zeros, the Data Type must be text.  And, if you must have consecutiveness
guaranteed, you'll need to create and code your own custom numbering system.
This is a frequently-discussed topic and if you do a search on "custom
numbering system in Access" in http://groups.google.com  you will get
numerous 'hits'.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

> Hello anyone,
>
[quoted text clipped - 16 lines]
>
> Jamie
- 31 Dec 2003 01:01 GMT
Thanks for your help Cheryl!

>-----Original Message-----
>Jamie,
[quoted text clipped - 48 lines]
>
>.
Cheryl Fischer - 31 Dec 2003 01:05 GMT
You're welcome!

--
Cheryl Fischer
Law/Sys Associates
Houston, TX
> Thanks for your help Cheryl!
>
[quoted text clipped - 64 lines]
> >
> >.
 
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.