Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ole idispatch exception code 0 from DTPicker
Message
From
06/03/2017 17:36:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/03/2017 13:38:01
Sonny Tabano
Trams Printwork, Inc.
Mabalacat, Philippines
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01648803
Message ID:
01648809
Views:
58
>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.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform