If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
date+time input mask
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#2
|
|||
|
|||
date+time input mask
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. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "cloclo via AccessMonster.com" u56862@uwe wrote in message news:a66e7bfdff019@uwe... 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#3
|
|||
|
|||
date+time input mask
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. cloclo wrote: 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#4
|
|||
|
|||
date+time input mask
thank you Arvin, for the response.
Arvin Meyer [MVP] wrote: 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
Thread Tools | |
Display Modes | |
|
|