• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

my dates keep automatically changing the days, months and years round when i don't want them to!

Hi, I have a database for holding orders that come to my company and along with other data it has to hold the date this order was from which gets typed in manually.

I made an input mask of: 99/99/00;0;_    to make the  /  /  automatically come up so they wouldn't need to be typed in manually but i originally had the date format dd/mm/yy to show the days, months and years correctly but it kept switching them around for no reason.  I've also tried changing it to short date and removing the format so it would stay as it was typed but it's still doing it and i don't know why.

if you typed 29th Oct 2004 it would change to 10/ 4/29.

how do i fix this?
0
WillHudson
Asked:
WillHudson
2 Solutions
 
NestorioCommented:
Have you tried setting the format property to "dd/mm/yyyy"?
0
 
rockiroadsCommented:
what is the regional setting on your PC? go to control panel, regional settings/options and check your locale
0
 
WillHudsonAuthor Commented:
the regional setting is GMT (greenwich mean time)
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
WillHudsonAuthor Commented:
I've tried the four-didget year format, it comes up with silly dates like 2019 as the year!!
0
 
leeskelton83Commented:
I understand that this is not exactly answering the question, but I would use the Calendar or Date Picker ActiveX Control . They are much cleaner. You can refer to them like Forms!Form1!ActiveXCtl1.
0
 
rockiroadsCommented:
dont bother with the masking, some people may prefer to enter dates using . or -

u could use the BeforeUpdate function to validate the input

private sub txtDateField_BeforeUpdate(Cancel as Integer)
    if nz(txtDateField.Value,"") <> "" then
          if IsDate(txtDateField.Value)=False then
               msgbox "Invalid date"
               cancel = true  'force user to stayin field
          endif
     endif
end sub


alternatively do what I did, create a combobox that holds the list of month names and years (depends on your application of course, mine is set to enter different years, but then I dont need to enter a day)

0
 
WillHudsonAuthor Commented:
never mind, i give up and i'll just make it a text field.
0
 
Steve BinkCommented:
Do not accept this as an answer.

Personally, I'd go with leeskelton83 and use a calendar control.  No confusion that way.  The setting Rockiroads was refering to is in the Regional Options dialog, under the "Date" tab.  There you can set the default format in which your dates are displayed, and Access adheres to this selection unless forced to do otherwise in code.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now