BasSchouten
IS-IT--Management
In my application an MDI form is opened (child) with the following code:
The OnClose event of the form contains:
Somewhere else in the application i want to check if the form exists, and if so, close it. I'v tried the following:
but i get an access violation when the second if statement executes ... I thought that freeing the form would set the form variable to NIL .. but apparently it doenst.
anyboy got any idea what i'm doing wrong??
Bas Schouten
System Development & Webdesign
CBIS BV Holland
Code:
Form_Faktuur = TForm_Faktuur.Create(Application);
The OnClose event of the form contains:
Code:
procedure TForm_Faktuur.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
Somewhere else in the application i want to check if the form exists, and if so, close it. I'v tried the following:
Code:
if Form_Faktuur <> nil then
if Form_Faktuur.Visible then
Form_Faktuur.Close;
but i get an access violation when the second if statement executes ... I thought that freeing the form would set the form variable to NIL .. but apparently it doenst.
anyboy got any idea what i'm doing wrong??
Bas Schouten
System Development & Webdesign
CBIS BV Holland