I created a custom class and put this code in a method to retrieve date values and store to the property of the class(.date1 & .date2). I then compiled this class as getdate.dll
WITH this
cSQL = [ SELECT * FROM ACCOUNTING!callinv WHERE callrefno = ]+ALLTRIM(STR (nCallrefno))
.oCallInvRS = .oConn.Execute(cSQL)
IF !.oCallInvRS.EOF()
.OCallInvRS.Movefirst
.date1 = .oCallInvRS.Fields("date1").Value
.date2 =.oCallInvRS.Fields("date2").Value
endif
endwith
In the load event of my form I created an instance of the dll and store it to a property of the form.
thisform.getdate = createobject(getdate.method1)
I then executed this method to get the date values and assign them to the property of the dll (date1 & date2). Date1 and Date2 and assigned as controlsource for the txtbox in the form.
Now if I have a .Null. value for date1 and an empty value( / / ) for date2 in the base table, Upon executing the dll, the return values will be 12/30/1899
Music Rocks
www.musicreserve.blogspot.comSuccess is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.