*---------------------- Location Section ------------------------ * Library: Acustomcontrols.vcx * Class: Txtdate * Method: Valid() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 01/26/2005 - NN * MODIFIED *---------------------------------------------------------------- IF !EMPTY(CHRTRAN(THIS.TEXT,"/.","")) AND EMPTY(THIS.VALUE) *This.Value=CTOD("^"+STR(YEAR(DATE()),4)+"-"+STR(MONTH(DATE()),2)+"-"+LEFT(This.Text,2)) WAIT WINDOW "Bad girl!" *=ErrorMsg("Wrong date typed!") =MESSAGEBOX("Why would you type such a date? ") *this.Value = {} RETURN 0 ENDIF>I am thinking maybe the following portion of code:
>IF !EMPTY(chrtran(This.Text,"/.","")) AND EMPTY(This.Value) > =ErrorMsg("Wrong date typed!") > WAIT WINDOW NOWAIT "Wrong date typed!" > RETURN 0 >ENDIF >>the condition is never met, in other words, your if statement evaluated to false.