Us date versus EU date problem

  • Thread starter Thread starter Jan T.
  • Start date Start date
J

Jan T.

I use Office2k and windows XP on two computers.

But, when I make a UserForm1 with a text box, my initialize procedure
set the TextBox1.Value = Date. However the result differ on the two PCs.

One UserForm shows US date format 10/2/2006. The other Computer has
exactly the same code but shows 02.10.2006 (e.i. October, the 2nd.,2006).

Know I want the european date format "dd.mm.yyyy". How can I achieve
this? Or what settings should I change?

Thanks in advance for helping!

Mvh
Jan.
 
Thank you for helping. But I am curious why my two Computers behave
differently?
I am using same OS and same software version. Another thing here is that I
am using
ADO 2.8 and will save records including dates.

There must be some settings I have overseen, don't you think?
Anybody?

Regards
Jan
 
try:

TextBox1.Value = Format(Date,"dd-mm-yyyy")
or
TextBox1.Value = Format(Date,"dd.mm.yyyy")
or
TextBox1.Value = Format(Date,"dd/mm/yyyy")
or
TextBox1.Value = Format(Date,"dddd dd.mm/yyyy")
or ...


"Jan T." skrev:
 
Maybe there's a difference between the windows short date format (under control
panel's regional settings)???
 
You can also check your regional settings in Control Panel to see if it is
set for English(United States) on both computers.

Jan T. said:
Thank you for helping. But I am curious why my two Computers behave
differently?
I am using same OS and same software version. Another thing here is that I
am using
ADO 2.8 and will save records including dates.

There must be some settings I have overseen, don't you think?
Anybody?

Regards
Jan
 
I have already checked regional settings but cannot find any different
settings

They sure look the same when it comes to date format, short date, middel
date and so on.

?
Jan

JLGWhiz said:
You can also check your regional settings in Control Panel to see if it is
set for English(United States) on both computers.
 
I have thought of that. Look what the following code returned:

In an other Standard Module I have a variabel
Public EuDate As Date

In the UserForms Module;

Private Sub UserForm_Initialize()
Me.TextBox1.Value = Date
EuDate = Me.TextBox1.Value
MsgBox "EUdato as US: " & EuDate ' Returns 10.02.2006
' This is what surprices me??? This also returns 10.02.2006
' even when I spesificly formated the date
MsgBox "Fomated: " & Format(EuDate, "dd.mm.yyyy")
' when the UserForm1 finally shows, the text box is
' showing 10\2\2006.
End Sub

I cannot format the date in this Example?


However in a standard module the following code return EU date format:

Sub TestDATE()
MsgBox Date ' Returns 10.02.2006
End Sub

Weird? This is what I am dealing with.

Regards
Jan
 
Back
Top