A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Leading zero's in a field



 
 
Thread Tools Display Modes
  #1  
Old April 3rd, 2007, 04:38 PM posted to microsoft.public.access.tablesdbdesign
matt22
external usenet poster
 
Posts: 19
Default Leading zero's in a field

How do I set up a field to accept a certain number of digits, for example
seven, and to display leading zeros for any entry that is not at least the
maximum number. In this case seven is the maximum I want for this field.

Display 123 as 0000123

Thanks.
  #2  
Old April 3rd, 2007, 04:54 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Leading zero's in a field

Set the Format property to:
0000000

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"matt22" wrote in message
...
How do I set up a field to accept a certain number of digits, for example
seven, and to display leading zeros for any entry that is not at least the
maximum number. In this case seven is the maximum I want for this field.

Display 123 as 0000123

Thanks.


  #3  
Old April 3rd, 2007, 06:44 PM posted to microsoft.public.access.tablesdbdesign
matt22
external usenet poster
 
Posts: 19
Default Leading zero's in a field

I tried that before. This does not display leadin zeros. If I enter 123 only
123 populate the field not 0000123 which is what I was looking for.

Any suggestions?

"Allen Browne" wrote:

Set the Format property to:
0000000

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"matt22" wrote in message
...
How do I set up a field to accept a certain number of digits, for example
seven, and to display leading zeros for any entry that is not at least the
maximum number. In this case seven is the maximum I want for this field.

Display 123 as 0000123

Thanks.



  #4  
Old April 3rd, 2007, 06:54 PM posted to microsoft.public.access.tablesdbdesign
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Leading zero's in a field

matt22 wrote:
I tried that before. This does not display leadin zeros. If I enter
123 only 123 populate the field not 0000123 which is what I was
looking for.

Any suggestions?


It will display leading zeros until you put your cursor into the field or
control. Then it reverts to what is actually stored to make editing easier.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #5  
Old April 3rd, 2007, 08:31 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Leading zero's in a field

Matt

What is stored, and what is displayed, are two different things.

Are you working directly in the table? If so, consider using Access forms
instead.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"matt22" wrote in message
...
I tried that before. This does not display leadin zeros. If I enter 123
only
123 populate the field not 0000123 which is what I was looking for.

Any suggestions?

"Allen Browne" wrote:

Set the Format property to:
0000000

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"matt22" wrote in message
...
How do I set up a field to accept a certain number of digits, for
example
seven, and to display leading zeros for any entry that is not at least
the
maximum number. In this case seven is the maximum I want for this
field.

Display 123 as 0000123

Thanks.





  #6  
Old April 3rd, 2007, 09:02 PM posted to microsoft.public.access.tablesdbdesign
matt22
external usenet poster
 
Posts: 19
Default Leading zero's in a field

Yes, I am working directly in the table in datasheet view. If I set the
format to 0000000 the table displays the numbers as entered, not with leading
zeros. When I run a select query on the table the numbers are displayed as
entered, not with leading zeros.

"Jeff Boyce" wrote:

Matt

What is stored, and what is displayed, are two different things.

Are you working directly in the table? If so, consider using Access forms
instead.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"matt22" wrote in message
...
I tried that before. This does not display leadin zeros. If I enter 123
only
123 populate the field not 0000123 which is what I was looking for.

Any suggestions?

"Allen Browne" wrote:

Set the Format property to:
0000000

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"matt22" wrote in message
...
How do I set up a field to accept a certain number of digits, for
example
seven, and to display leading zeros for any entry that is not at least
the
maximum number. In this case seven is the maximum I want for this
field.

Display 123 as 0000123

Thanks.





  #7  
Old April 3rd, 2007, 09:50 PM posted to microsoft.public.access.tablesdbdesign
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Leading zero's in a field

matt22 wrote:
Yes, I am working directly in the table in datasheet view. If I set
the format to 0000000 the table displays the numbers as entered, not
with leading zeros. When I run a select query on the table the
numbers are displayed as entered, not with leading zeros.


Formatting is not inherited. Even if you saw the formatting you wanted in
the table you would have to set the same formatting on the field of your
query and then again in any form or report used by the query.

In your table are you sure that the formatting is not working when your
cursor is NOT in that field? If so then you must have set it incorrectly.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.