>*---------------------- Location Section ------------------------ >* Library: Acustomcontrols.vcx >* Class: TxtDOB >* Method: Valid() >*----------------------- Usage Section -------------------------- >*) Description: >*) > >* Scope: Public >* Parameters: >*$ Usage: >*$ >* Returns: >*--------------------- Maintenance Section ---------------------- >* Change Log: >* CREATED 04/19/2005 - NN >* MODIFIED 04/20/2005 - NN >*---------------------------------------------------------------- >local llReturn, lcYear, lnYear >if this.lValidationCancelled > llReturn = .t. > this.lValidationCancelled = .f. >else > llReturn = not empty(dodefault()) > if m.llReturn > lcYear = ALLTRIM(substr(this.text,rat('/',this.text)+1,4)) > if LEN(m.lcYear)<3 AND val(m.lcYear) = int(year(date())%100) && Same year typed as 2 digits > this.Value = IIF(this.value > DATE(), DATE(YEAR(this.Value)-100,MONTH(this.Value), > if this.value > date() > llReturn = .f. > =ErrorMsg ("Date of birth could not be greater than today's day!") > endif > endif > endif > > return m.llReturn >