Us date versus EU date problem

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.
 
J

Jan T.

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
 
G

Guest

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:
 
D

Dave Peterson

Maybe there's a difference between the windows short date format (under control
panel's regional settings)???
 
G

Guest

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
 
J

Jan T.

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.
 
J

Jan T.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top