Form closes after press Cancel button on INPUT DIALOG.

Hi, friends!

I have a problem with INPUT standart NAVISION user dialog on input valid Date variable using it.

Here the trigger OnInputChange for Text Box and function RunDateDialog. On input some change to Sell-to Customer No. filed Form’s trigger OnInputChange runs and rise up an INPUT dialog according to source code below. If user enter nothing to input field and press Cancel buton on INPUT dialog, INPUT dialog doesn’t return anything and whole calling form closes.

Does any one know what the reason of such behavior?

Thank’s in advance [:)]

Sell-to Customer No. - OnInputChange() :
Rec.CALCFIELDS(“Customer Balance”,“Order Amount”);
CurrForm.UPDATE(TRUE);
DialogReturn := FALSE;
IF (“Customer Balance” - “Order Amount” > 0) AND (“Exp. Payment Date” = 0D) THEN BEGIN
WHILE NOT DialogReturn DO BEGIN
DialogReturn := RunDateDialog;
END;
END;
“Exp. Payment Date” := PaymentDate;
CurrForm.UPDATE(TRUE);

RunDateDialog() result : Boolean
CLEAR (PaymentDate);
DialogReturn := 1;
DialogExpPaymentDate.OPEN(Text004,PaymentDate);
DialogReturn := DialogExpPaymentDate.INPUT(1,PaymentDate);
DialogExpPaymentDate.CLOSE;
IF (PaymentDate = 0D) OR (DialogReturn = 0) THEN
EXIT (FALSE)
ELSE
EXIT (TRUE);

Text004 : Some text #######1#