Gossamer Forum
Home : Products : DBMan : Customization :

Where to place zero padding code

Quote Reply
Where to place zero padding code
I have a month and day field both of which are two digits in length. I want to keep any numbers that are less than 10 padded with a leading zero. I know how to write the code to check for and insert the leading zero but I don't know the beat place to put it in the dbman code. What I'm looking for is to allow users to enter a one digit month or date and have dbman insert the leading zero so they don't have to.

Let's say they enter "1" for January... I want the month field to be written as "01" without the user having to remember to add the leading zero. I'd probably have to add the "leading zero" code to the "add new record" and "modify record" subs at minimum (I think) Is there a batter place to perform this check where I'd only have to write it once?

I was originally thinking I could do it with valid_expr but then I realized that valid_expr only checks to see if your field is valid and it doesn't actually change it to make it valid.
Subject Author Views Date
Thread Where to place zero padding code acravens 5502 Feb 10, 2005, 3:35 PM
Thread Re: [acravens] Where to place zero padding code
LoisC 5361 Feb 11, 2005, 11:39 AM
Thread Re: [LoisC] Where to place zero padding code
acravens 5360 Feb 11, 2005, 12:23 PM
Thread Re: [acravens] Where to place zero padding code
LoisC 5346 Feb 11, 2005, 10:13 PM
Thread Re: [LoisC] Where to place zero padding code
acravens 5371 Feb 12, 2005, 10:56 AM
Thread Re: [acravens] Where to place zero padding code
acravens 5349 Feb 12, 2005, 11:07 AM
Post Re: [acravens] Where to place zero padding code
Watts 5359 Feb 12, 2005, 11:43 AM
Post Re: [acravens] Where to place zero padding code
LoisC 5371 Feb 12, 2005, 9:55 PM