I still have trouble with Date Formats. Why is it so ?

C

Corey

An earlier post of mine i received some advice about changing the format of my PC(control
panel-Language-AUSTRALIA dddd dd mmmm yyyy = date long),
But now when i ma trying to use a Calendar popup(userform) to enter a date into a textbox, i keep
getting the date in ODD manners.

If the DAY selected is >12(only 12 months per year) i get the Correct date Format (eg. Thursday 22
February 2007),
yet if i select a DAY <=12, then i get (eg. for 1 Feb 2007 Friday INSTEAD i get[ Tuesday 2 January
2007]).
Which means the DAY and MONTH are being switched around.

How can i prevent this?


'This is the code to show the calendar
Private Sub TextBox25_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If UserForm3.TextBox25.Value = "" Then
Call OpenCalendar
UserForm3.TextBox25.Value = Format(TextBox25.Value, "dddd dd mmmm yyyy")
End If
End Sub

'This is the code to input the date into the textbox
Option Explicit
' ===================================================
' Code by Martin Green eMail (e-mail address removed)
' Visit my Office Tips web site at www.fontstuff.com
' ===================================================

Private Sub cmdClose_Click()
' Close the UserForm
Unload Me
End Sub

Private Sub UserForm_Initialize()
' Check if active cell contains a date. If 'yes' show
' same date on calendar. If 'no' show today's date.
Calendar1.Value = DateValue(Now())
Calendar1.Value = Date
End Sub

Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
UserForm3.TextBox25.Value = Calendar1.Value
Unload Me
End Sub


Am i doing somehting wrong ?

Corey....
 

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