I'm not sure following codes will work fine, because after "self.close" then there are no place to return to. If you want to use following form then you have to define
CloseAction := caNone; in FormClose event, and free the form somewhere else in the calling part.
procedure TForm_Evaluaties_2019_Referee.Evaluatie_Referee_2019_Sluiten;
begin
// Form_Evaluaties_2019_Referee.Close;
Self.Close;
end;
I think if you want to make only one form instance during the application's run, you may have it created (and destroyed) automatically.
Or if you can show the form in modal mode, then you'd better use showmodal instead of show.
with TForm_Evaluaties_2019_Referee.Create(nil) do begin
try
Evaluatie_ID := Save_ID;
Wedstrijd_ID := Save_WD;
if ShowModal = mrOK then begin
// if Form_Lint is calling form, then you can replace Form_Lint with self.
Form_Lint.vs_Linten.Tag := Form_Lint.vs_Linten.Tag - 1;
Form_Lint.Btn_Actie_Cancel.Enabled := True;
Form_Lint.Btn_Actie_Update.Enabled := True;
Form_Lint.Btn_Actie_OK.Caption := 'OK & Close';
Form_Lint.Lint_Acties.Hide;
Form_Lint.Lint_Aanzetten (Form_Lint.vs_Linten.Tag);
// and others do whatever you want to do here
end;
finally
Free;
end
end;
Sorry if this is not helpful.