Error message time field

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

How can i avoid the default Access error message when you input a wrong
value for a time field?

Defined it with a inputmask: 00:00;0;_. When a user type a 5 instead of
05:00 you get a default Access error message. How can i replace this with my
own?

Or even better how can i get Access to accept the value 5 and store it as
05:00?

Thanx for any tips!

Regards,

Harmannus
 
Answer: Put in the correct value <grin>.

One of the reasons for this is that Access needs to know if
this is an AM or PM time. If you lose the input mask and
just use the table field formatting for the desired time,
you can lose the leading zero for 5:00 AM.

Gary Miller
 
Hallo,

Thanx for the tip!

Can i trap the default Access error message for incorrect times? Ideal would
be a message of my own suggestion the right format...

Regards,

Harmannus
 
I would think that you could by using the BeforeUpdate event
to examine the entry and using Cancel = True to cancel the
actual Update.

To take this farther, with a little work you could probably
reformat an entry if it met allowable conditions and put it
into the format that Access needs. This would all have to be
done with VBA.

Gary Miller
 
Back
Top