PDA

View Full Version : Help with date format



kevvukeka
02-09-2015, 07:40 AM
Hi all,

I have a userform that allows users to update their time on daily basis. The format which we set was DD-MMM-YYYY. Now when we gave the timesheet to users, it didn't worked on few machines as the date setting of that machine was in mm-dd-yyyy format.

the line which I used to update text box on userform is as follows:


UF1.txtDate.Value = Format(Date, "dd-mmm-yyyy")

Is there a way, the code can identify the system date setting on its own and format it accordingly?

I mean if its in "mm-dd-yyyy" format , can we get it converted to "dd-mmm-yyyy "format

Thanks for your help.

Aflatoon
02-09-2015, 08:00 AM
Don't format it at all:

UF1.txtDate.Value = Date

kevvukeka
02-09-2015, 10:58 PM
Thank you Aflatoon..

TomQuach
02-10-2015, 11:29 PM
snb, thank you. That did the trick!