LOCAL lcMonth, lcDate, lcDay, lcYear, lcTime With This lcDay = STR(.Day,2) lcYear = STR(.Year,4) lcMonth = STR(.Month,2) * lcTime = str(.Time()) lcDate = lcMonth +"/" + lcday+"/"+lcYear WITH ThisForm .txtEndDate.Value=ctod(lcDate) * .txtEndDate.setfocus() **** Check if end date (.OleDatePicker4) is earlier than start date (. (OleDatePicker3) IF .txtEndDate.Value <= .txtStartDate.Value .txtStartDate.Value=.txtEndDate.Value - 1 *** Replace the following .OleDatePicker3.Month=MONTH(.txtStartDate.Value) .OleDatePicker3.Day=Day(.txtStartDate.Value) .OleDatePicker3.Year=Year(.txtStartDate.Value) ENDIF ENDWITH ENDWITHthe error happens only on these dates between April 1-3, for example when startdate is April 2 and enddate is april 3, when i change enddate to april 1, startdate shlould change to Mar 31. but it doesn't change on the date picker and this error message appears, but it does change the value on the (textbox) .txtStartdate