How to set date/time format during edit - ms-access

I set the date/time format and Input Mask in a field to display/input a 24 hour format Dec-28-2006 # 12:12 but when I edit the field with an existing date it reverts back to Dec/28/2006 12:12:00 PM.
Format is set to "mmm-dd-yyyy # hh:nn
Input Mask is set to ">L
I need to keep the field in this mode (Dec-28-2006 # 12:12) when editing an existing date/time. Is this possible?

That is by design, and it takes a lot to make it behave differently.
You may get some inspiration from my two articles and their demo applications:
Entering ISO formatted date with input mask and full validation in Microsoft Access
Entering 24-hour time with input mask and full validation in Microsoft Access
If you don't have an account, browse for the link: Read the full article.
Too much code to post here, but code is also on GitHub: VBA.DateEntry and VBA.TimeEntry.

Related

Need a proper input mask for a time field in Microsoft Access

My table field is date/time and formatted like this:
mm/dd/yyyy hh:nn:ss
I want the user to see this (with the space appearing between date and time
__/__/__ __:__:__
I want an input mask that demands:
Either 1 or 2 digits for the month
Either 1 or 2 digits for the dat
All 4 digits for the year
SHOWS the space but just jumps over it for the user
Either 1 or 2 digits for each of Hours, Minutes and Seconds
Further, when setting up a DB, is it just smarter to have two separate fields for Date and Time. A collegue encouraged me to break them out ... seems sensible?
00/00/0000##00:00:00
See the outcome in the image
Controlled user input is not an easy task in Access, as it is optimised for the opposite: To be tolerant and accept many input sequences for date and time.
For the cases where controlled input is mandatory, I've written two articles including full code (too much to post here) and demo, that may give you some ideas:
Entering ISO formatted date with input mask and full validation in Microsoft Access
Current code at VBA.DateEntry.
and
Entering 24-hour time with input mask and full validation in Microsoft Access.
Current code at VBA.TimeEntry.

Changing the date format in Access 2010

I want to show the Purchase_Date in dd/mm/yy format . I already set the Format in form properties as dd/mm/yy
When i select a cell in database view it shows the date in dd/mm/yy but it still shows the date in mm/dd/yy otherwise
I need 05/02/14 to show as 02/05/14 at all times
This is by design. When the control gets focus, it will revert to the default format as to the settings in Windows.
A workaround can be to use three concatenated textboxes, but it requires some code to operate nicely.
You have to go to the Region and Language in the Control Panel and choose "English (Autralia)" as the format in the formats tab. Then change the short date format from the option below as you require. The format you want is available there.
Edit:
A better way to do it is to apply your own format. In the Format property of the properties of the Date/Time field, you can type in the format you want using placeholders and separators.
Hope this solves your problem.

ms access input mask MM/DD/YYYY

Hi Im working in the UK creating a MS Access application. I have a textfield which will take in the date of something based on this format: MM/DD/YYYY.
However as I'm in the UK it uses the Short Date format of DD/MM/YYYY. How do I ensure it uses MM/DD/YYYY? Will it do this automatically if the application is opened in the states? Or do I have to provide an Input Mask and some VB code to sort it?
Thanks
Sorted it - if you create a textfield and then change its format to MM/DD/YYYY - this will change whatever you enter into the American format - so for example you entered the UK format (DD/MM/YYYY) as 12/03/2012 this would change to 3/12/2012.
This solved my problem but others may arise if you wished to compare two date values or something. Hope this helps...

Data Type Error when added Input Mask on Date Time Field

i have a date/time field called MyDate. Originally, its format is mm/dd/yyyy and there is no input mask. The Date Picker is also set. I then added input mask using Short date , changed the default input maks to (99-99-0000;;_) and change the format to mm-dd-yyyy. However, when i switch to DataSheet view , all my dates are changed from mm/dd/yyyy to mm-dd-yyyy (which is the correct behaviour right? ) and when I tried to enter a new date or modify existing date, it says "The value you entered does not match Date/Time data type in this column". Plus, the DatePicker is missing. How can I resolve this. thank you
The date time picker is not available if an input mask is applied to a field: http://office.microsoft.com/en-us/access-help/add-and-customize-date-and-time-formats-HA010078108.aspx#_Toc272229486
Regarding the error, have you considered using your regional settings in the control panel, which sets the defaukt date display for all (most?) applications?
Dates in Access are stored as numbers, so you can format them however you like, but I suspect the input mask may need to match the regional settings, although I am not certain.

Date prompt in BO

I have a webi report that accepts a date input.
I need to receive data from the user in the format "dd-Mmm-YYYY"; however the calendar control that BO presents to the user for date selection is always shown in M/DD/YYYY HH:MM:SS AM/PM.
Is there any way to control this behaviour?
Have you tried changing all the date fields in the Universe designer to the format that you want? You can either format them using SQL in the select statement box of the "Object Properties", or you can change the format of the field by right clicking and selecting "Object Format..."
I'm pretty sure that would affect the way the end user sees it.
you can set the date format (and all other format ) on the locatizion parametrs on the user setting for each user you have in cms , simply by the infoview preferences for each user .
home screen of central management -> preferences - > Preferred Viewing Locale + local time zone.
or
home screen of infoview -> preferences - > Preferred Viewing Locale + local time zone.
this will set also the date prompt format
There's another option.
On the BO server there's a javascript file that is used to create the calendar popup.
..\Tomcat55\webapps\AnalyticalReporting\viewers\cdz_adv\lib\calendar.js
Inside this file there's a function called CTFB_setFormatInfo which if passed a date format uses it ... if not there's seems to be a hard coded default of "MM/dd/yyyy hh:mm:ss a".
I'm pretty certain this is not updated by the other dozen ways to set the date format found in BO (user prefs, prn file, object properties ect).
function CTFB_setFormatInfo(format,arrDays,arrMonth,AM,PM)
{
var o=this
o.arrMonthNames=arrMonth?arrMonth:_month
o.arrDayNames=arrDays?arrDays:_day
o.format=format?format:"MM/dd/yyyy hh:mm:ss a"
o.AM=AM?AM:_AM
o.PM=PM?PM:_PM
}
I just updated this file - and now I get consistent dd/mm/yyyy - without pesky mm/dd/yyyy randomly turning up when the preference isn't passed through.