Prevent Form With Missing Data From Closing

I am using the following code to warn users about missing data and asking them if they wish to proceed: Form - OnQueryCloseForm() : Boolean

IF CheckFields AND Modified THEN BEGIN
  Modified := FALSE;
  EXIT(CONFIRM('Do you want to close the form?'));
END;

Ideally, I would prefer to prevent the user from closing the form until the required data is entered… is this possible? Rick

if you search the forum for “Mandatory Fields” will will find many posts. Here’s one: http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=645&SearchTerms=MANDATORY,FIELDS

Thanks for pointing me - my searches were on the wrong track. Rick