Leading zeros in Short Time mask

  • Thread starter Thread starter Steve Halis
  • Start date Start date
S

Steve Halis

I am using the Short Time mask in a form but when I type
in the zeros(04:30), Access removes them (4:30). I have a
button to duplicate the form, but once duplicated I get an
error dialog saying that the data in the field doesn't
match the mask; because the zero was removed.
How do I get the field to display the leading zero?
The mask I am using is -> 00:00;0;_
 
Steve-

I ran into a similar problem recently with a date/time input mask. The
problem is an input mask formats and controls the text, but a date/time data
type (this is the data type of the underlying field, right?) stores the
value as a floating point. Access does a good job of converting any text
that it can recognize into the internal date/time value. However, if you
attempt to assign a date/time value to a control that has an input mask, you
must first convert it back to text that matches the mask. So, you'll need
to do something like:

Me.StartTime = Format(datSavedTime, "hh:nn")

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top