Hi, I have two date picker controls on y userform, a start date and an end date. I want to ensure that the user cannot leave the startdate if its > the end date. I tried the following code in the control exit event but it didn't work, although I got the error message appearing the cursor just jumped to the next item and did not stay in the startdate item. What am I doing wrong?
if stardate > enddate then
msgbox("start date must be <= enddate"
startdate.setfocus
end if
if stardate > enddate then
msgbox("start date must be <= enddate"
startdate.setfocus
end if