PDA

View Full Version : Cant Shift date problem!



thomas.szwed
08-07-2008, 02:09 AM
aarrggh!

I have a really annoying date problem which i still cant resolve.

Please see the attached workbook.

Open it up (password = pastille)

Click on the pencil symbol and fill in the fields to add a new record.

On the date fields try entering in 01/10/2008 and 06/07/2008 (few examples of dates that screw up). Once you add the record, look at the details on the screen. You will now see that the dates have swapped around to american format. I have tried altering some of the code from .value to .text but it doesnt always allow this and comes up with an error message.

The problem is quite deep, because when you open up the userform and then type in the row number you wish to view in the bottom right hand corner, it populates the date boxes on the userform in number format e.g. 35469 -

Can anyone help me!!!!!!

Thanks in advance......

Kenneth Hobs
08-07-2008, 08:16 AM
I did not look into it much but did you set the NumberFormat for the date cells? Did you convert the text date from the combobox into a date?


'change
c.Offset(0, 5).Value = Me.ddlEndDate.Value
'to
c.Offset(0, 5).Value = CDate(ddlEndDate.Value)
c.Offset(0, 5).NumberFormat = Format(CDate(ddlEndDate.Value), "mm/dd/yyyy")
You may need some other code to verify that a true date has been entered.