Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE IDispatch exception code 0 from DTPicker

Status
Not open for further replies.

klander2k

Programmer
May 5, 2003
14
0
0
US
Today 2/29/08 (Leap Year) I got the following error:

OLE IDispatch exception code 0 from DTPicker: Invalid property value.

If I change the system date to 1 day prior or 1 day later all works well.

Any one else having this same problem?
Any suggestions.

Thanks

Keith Lander
klander2@comcast.net
 
I also got this error but I am not sure how to resolve this.
I get this error in the init event of the Olecontrol I set the value of the control as follows:

** ldStd is a variable with todays date
With this
.day=day(ldStd)
.month=month(ldStd)
.year=year(ldStd)
Endwith
 
I am using basically the same code as Kurjo.

.MONTH = MONTH(DATE())
.DAY = DAY(DATE())
.YEAR = YEAR(DATE())

I can run the following in the command window and all works well.

? MONTH(DATE())
? DAY(DATE())
? YEAR(DATE())

Pretty confusing......



Thanks

Keith Lander
klander2@comcast.net
 
I solved my issue as follows:

With this
.day=day(date())
.year=year(date())
.month=month(date())
endwith

If we assign the month value at the end it takes. I hope it will help.

 
Try adding .object to the hierarchy. In other words, instead of this:

oleControl.Day = day(date())

do this:

oleControl.object.Day = day(date())

In fact, if you do that, you can set the value directly:

oleControl.object.Value = DATE()

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top