Error message time field

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
 
G

Gary Miller

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
 
H

Harmannus

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
 
G

Gary Miller

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top