setdatae() DO Form frmdatetimepicker.scx proc SETDATAE set talk off SET DEVELOPMENT ON SET REPROCESS TO 30 SECONDS set notify on set strictdate to 1 set sysformats on set hour to 24 LOCAL ldDate, lcDate ldDate = {^2001-12-31} lcDate = DTOC(ldDate) DO CASE CASE RIGHT(lcDate,IIF(SET("Century")='ON',4,2)) = ; RIGHT(ALLTRIM(STR(YEAR(ldDate))),IIF(SET("Century")='ON',4,2)) ; AND LEFT(lcDate,2) = ALLTRIM(STR(MONTH(ldDate))) SET DATE MDY CASE RIGHT(lcDate,IIF(SET("Century")='ON',4,2)) = ; RIGHT(ALLTRIM(STR(YEAR(ldDate))),IIF(SET("Century")='ON',4,2)) ; AND LEFT(lcDate,2) = ALLTRIM(STR(DAY(ldDate))) SET DATE DMY CASE LEFT(lcDate,IIF(SET("Century")='ON',4,2)) = ; RIGHT(ALLTRIM(STR(YEAR(ldDate))),IIF(SET("Century")='ON',4,2)) ; AND RIGHT(lcDate,2) = ALLTRIM(STR(DAY(ldDate))) SET DATE YMD OTHERWISE && Not sure what to do, date format is not recognized ENDCASE SET CENTURY ON && must be after SET SYSFORMATS set excl off set escape off set print off set cons on set device to screen set step off set ansi on set autosave on set talk nowind set compatible foxplus set cpdialog off set status bar off set readborder on SET BELL OFF SET HEADING OFF SET MENU OFF SET SAFETY OFF set exact on set near on set deleted on set udfparms to reference returnafter that frmdatetimepicker form does not close: clicking to its upper