>>LOCAL llError >>DO case >>CASE EMPTY(m.this.Value) >> local lcText >> lcText = strtran(m.this.text,"AM","") >> lcText = strtran(m.lcText,"PM","") >> lcText = strtran(m.lcText,"M","") >> >> if !empty(chrtran(m.lcText,"/.:-"," ")) >> **************************************** >> * I'm not sure that you can run here >> **************************************** >> >> *This.Value=CTOD("^"+STR(YEAR(DATE()),4)+"-"+STR(MONTH(DATE()),2)+"-"+LEFT(This.Text,2)) >> =ErrorMsg('Please enter a valid date',0+16,"Error in date entry") >> llError = .t. >> endif >> >>case m.this.value < m.this.dRangeLowBound >> =ErrorMsg('Please enter a correct year',0+16,"Error in date entry") >> llError = .t. >>endcase >> >>return IIF(m.llError, m.this.dRangeLowBound, {}) && so it would work for empty dates>
return IIF(m.llError, m.this.dRangeLowBound, NULL) && so it would work for empty dates/datetimes