ldDate = Thisform.txtTransDate.Value ldDateType = VARTYPE(ldDate) ldDate = IIF(ldDateType = "D" , DTOC(ldDate) , ldDate) lnMonth = MONTH(CTOD(ldDate)) lnDay = DAY(CTOD(ldDate)) lnYear = VAL(IIF(EMPTY(ALLTRIM(RIGHT(ldDate,4))),'0',RIGHT(ldDate,4))) lnLenYear = IIF(EMPTY(lnYear),0,LEN(ALLTRIM(STR(lnYear))))and do the following test
IF lnMonth = 0 OR lnDay = 0 OR lnYear = 0 OR lnLenYear <> 4 error processing and message ENDIFIs there a reason that the above would not work?