Код:
Calendar.RUNMODAL; // Opens form
IF Calendar.GetDate <> 0D THEN // This stops the calendar from returning a blank date.
SETRANGE(DateFLD,Calendar.GetDate); // Returns date selected and validates the variable
CLEAR(Calendar); // Clears the old form