Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to change American date format in text box on a form

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
I've made a form in Excel that is used to enter data into a spreadsheet. One of the fields is a textbox that the user can enter a date into. I've formatted the cells in excel that the date is added to as dd-mmm-yy format, the problem i have is that when the user adds a date to the form it is being read as an american date format (eg mm/dd/yyyy) this has caused a lot of problems as users of the form are not used to adding dates in this manner.

Does anybody know a way to sort this problem?
 
Easiest way is to read the textbox contents as a string and then use Val() and Format() to adjust to a true date as you desire.


another option would be to use 3 sets of dropdowns - 1 for days, 1 for months, 1 for years and then concatenate together in code, again using Val() and Format()

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
The other way is to use the Date Time Picker control which ensures that the value is always a recognisable date.

Cheers

Rog
 
Rog

Whats the date time picker control and how do i access it in conjunction with my form?

Cheers

DrS
 
Just found the date time picker.... Unfortunately we don't have a liscence to use it.... Looks like i'll be using your method xlbo (Slightly more labour intensive but cheaper!!!!)

Cheers for your help guys

DrS
 
aw c'mon

myDate = format(Val(textbox1.text),"dd/mm/yyyy")

isn't that labour intensive....

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Surely this is a machine configuration issue in that the date input could be configured using the regional settings applet in the control panel ?

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Fair enough xlbo.... I bow my head in shame....
 
no need for shame Doc....course - if it doesn't work, I will be doing similar !!

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top