PDA

View Full Version : date problem on a form



philfer
08-27-2010, 02:07 PM
Hello,

I have a userform with two testboxes for start and end date and command buttons which open another userform which has a calendar control on it.

When I do :-

frmAddNew.Controls("txtStartDate").Value = CDate(Calendar1.Value)

after choosing the 27th of August I get :-

8/27/2010

but when I do :-

frmAddNew.Controls("txtStartDate").Text = CDate(Calendar1.Value)

I get :-

27/08/2010

My system date is set to UK and I want :-

27/08/2010

I wan wondering why I cant use .Value


Thanks
Phil

Kenneth Hobs
08-27-2010, 04:45 PM
Try the Format command?
frmAddNew.Controls("txtStartDate").Text = Format(CDate(Calendar1.Value),"mm/dd/yyyy")

or some variation.

rbrhodes
08-29-2010, 08:48 PM
Excel dates...