I have form 1 and it has a field that in the onExit action I search the code in the bank and if it does not, I'll send a message if I want to register a product. If yes opens form 2, now I am not able to get the generated field and send to form 1, follow the template:
with form do
begin
form:=Tfrm_formulario2.Create(Application);
Centraliza_Form(form);
form.ShowModal;
if(form.ShowModal=mrYes)then
begin
campo.campos^[2].valorInteiro:= form.campoCodigo.AsInteger;
end;
Release;
end
In form 2 in the save button action I want the screen to close and return the value of the Code field, follow the code:
ModalResult := mrYes;