date+time input mask

  • Thread starter cloclo via AccessMonster.com
  • Start date
C

cloclo via AccessMonster.com

Hi,
I have a textbox where I'd like users to input date and time in the format:
mm/dd/yyyy hh:mm AM (or PM).

My input mask is: 00/00/0000\ 00:00\ >LL

The format is General Date.

The column this textbox is bound to on the table is date/time with format of
General Date.

When I input a date and time, I'm getting an error. I input 03/31/2010 01:
15 AM. When I tab off the field, I get the following message: "The value you
entered isn't valid for this field".

What am I doing wrong?

thanks.
CLO
 
A

Arvin Meyer [MVP]

You need to understand the Microsoft date format. Dates are Doubles ("with
an attitude" IOW, just any Double won't necessarily work) Zero (0) is
December 30, 1899. The integer portion of the double (actually more
appropriately called a long) or portion to the left of the decimal which
counts the number of days since 12/30/1899. The decimal portion (to the
right of the decimal point) is the time portion. So .5 is noon, .75 is 6:00
PM, etc..

No matter how you enter the date, it will store it that way. So just make
sure that both date and time are entered, and use the format property to
display it the way you want. Any input mask that you use must be matched
from the table. So if you are using a General Date, change it in the table.
 
C

cloclo via AccessMonster.com

Hi,
For anyone else with this issue, here is the mask that finally worked:
99/99/0000\ 99:00:00\ >LL;0;_
use it in good health.
 
C

cloclo via AccessMonster.com

thank you Arvin, for the response.
You need to understand the Microsoft date format. Dates are Doubles ("with
an attitude" IOW, just any Double won't necessarily work) Zero (0) is
December 30, 1899. The integer portion of the double (actually more
appropriately called a long) or portion to the left of the decimal which
counts the number of days since 12/30/1899. The decimal portion (to the
right of the decimal point) is the time portion. So .5 is noon, .75 is 6:00
PM, etc..

No matter how you enter the date, it will store it that way. So just make
sure that both date and time are entered, and use the format property to
display it the way you want. Any input mask that you use must be matched
from the table. So if you are using a General Date, change it in the table.
Hi,
I have a textbox where I'd like users to input date and time in the
[quoted text clipped - 19 lines]
thanks.
CLO
 

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

Top