Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Leading Zeroes in Numbers and Dates

Status
Not open for further replies.

mjones219

Technical User
Jun 26, 2002
9
US
How do I make number fields (autonumber and/or number) display the leading zeroes, such as 0007?
Also, How to default date fields to show leading zeroes, such as 06/02/02?
 
For leading number in an autonumber or number field, set the format property to the TOTAL number of digits....in other words if you want 00007, then set the format property to 00000.

For dates, to make the zeros appear, set the format property to mm/dd/yy. The mm means months 01-12, the dd means days 01-31 and the yy means year 00-99. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Thanks for the prompt response!
Question: When the date format is mm/dd/yy does this mean the user has to input the leading zeroes? I would like it to allow for input such as 1/1/1, and then to show as 01/01/01. (I work with "grownup-babies" and they think that having to type "0" is such a pain!)
 
First, let me briefly explain Format versus InputMask....

InputMask describes the format you must type to enter data. So if you put 00/00/0000 in the InputMask you would have to type 01/01/2001 to get January 1, 2001.

Format, on the other hand, merely displays the data in the format you provide. So if you put mm/dd/yyyy in the format, but the data was 1/1/01...it would be displayed as 01/01/01.

I would take a close look at the Help Files for each of these property....they explain it a lot.

That being said....

No....the users won't have to enter the zeros usless you want to make them have to.....It is totally up to how you set these two properties...

For example, I prefer to enter dates as 01/01/01...this makes them all the same length and the like and searching against them is quick and easy. But my users prefer to see the data as January 01, 2001. SO I set the InputMask as 00/00/00, and thereby making the users enter 01/01/01 to input data, and I set the Format as mmmm dd, yyyy...which display the data as January 01, 2001. Again i go back to looking at the Help fiels for all the definitions of these properties and their uses.

Good Luck! Let me know if you have any more questions..... It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Or.....

How about using a DatePicker control or Calendar control.....then they don't have to type and you don't have to validate the date......

Craig
 
I am familiar with the Calendar Control, however I am not familiar with the DatePicker control.
Do both require the user to manipulate the mouse to input this type?
It tends to slow down the input of data when the user has to switch between the keyboard and the mouse and then back to the keyboard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top