*---------------------- 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) = year(date())%100 && Same year typed as 2 digits this.value = iif(this.value > date(), gomonth(this.value, - 100*12), endif if this.value > date() llReturn = .f. =ErrorMsg ("Date of birth could not be greater than today's day!") endif endif endif return m.llReturnand I set nCentury and nRollover properties in the Property sheet.