> I had remote view created from ORACLE, and ORACLE ODBC driver by default create datetime
> datatype for date field. If I bound this view field to TextBox Control with
> controlsource property of form, then form display date & time on the form and user had
> to enter date and time or press enter after entering date to avoid time entry.
>
> I want just date to be displayed in TextBox Control and when user finishes date entry
> cursor should move to next field skiping time.
>
> I had tried by setting input mask/ format property of TextBox as ##/##/##, 99/99/99, it
> does not work. Any help in this regard is most welcome.
>
> DO WHILE .T.
> Thanks in Advance
> ENDDO
>
> Waheed.
Hello Everybody,
I had solved this proble in this way and its working fine. Any suggesstions or
comments are most welcome.
DEFINE CLASS Cdate As TextBox
Value = "{ / / }"
*Controlsource should be blank
ControlSource = ''
Format = 'D'
InputMask =''
Name = 'Cdate'
*User defined property, used for assigning controlsource. In a instace of this
class assign the file field source as this.Source = Invoice.Date, where Invoice is the
filename and Date; is the value of the filed to be displayed in the control.
Source = ''
PROCEDURE LostFocus
IF this.value # TTOD(EVAL(this.Source))
* If u want to preserve time, convert file field datetime to character
using TTOC(), change date with this value using LEFT() and convert to datetime again
using CTOT().
REPLACE (this.source) WITH this.value
ENDPROC
PROCEDURE Refresh
this.value = TTOD(EVAL(this.Source))
ENDPROC
ENDDEFINE
Waheed
email:
mbws@batelco.com.bh