>Hi everyone,
>
>need help on how to fix this error and what might have caused this error: ole idispatch exception code 0 from DTPicker
>
>thanks
>
>Sonny
That error should have additional message. Most probably you are trying to set its date using day, month, year properties (which is unnecessary) and doing it in wrong order. If it is the case, correct way of setting those properties is like this:
with oDtPicker
.Day = 1
.Year = 2000
.Month = m.desiredMonth
.Year = m.desiredYear
.Day = m.desiredDay
endwith
Better and easier way is to directly set its value to a datetime value. ie:
oDtPicker.Value = datetime()
oDtPicker.Value = cast(date() as datetime)
You may also want to use the dtControl from Foxyclasses which behind the scenes use DtPicker.