Hi Fabio,
You've got the 'save and add another record' attached to the 'onclick' event.
Try moving it to the 'onafterclick' event and it should be okay.
procedure frmInserimento_bSalvacontinua_OnAfterClick (Sender: TObject);
var
i : integer;
begin
for i:= 0 to frmInserimento.ComponentCount -1 do
if frmInserimento.Components[i] is TdbEdit then TdbEdit(frmInserimento.Components[i]).Clear;
for i:= 0 to frmInserimento.ComponentCount -1 do
if frmInserimento.Components[i] is TdbComboBox then TdbComboBox(frmInserimento.Components[i]).Clear;
for i:= 0 to frmInserimento.ComponentCount -1 do
if frmInserimento.Components[i] is TdbStringGridEx Then TdbStringGridEx(frmInserimento.Components[i]).ClearRows;
end;
Although I wrote that I think Option 3 is probably the technically 'correct' way to do it, I think I would probably go with Option 4 simply because the script is simpler.
Still, so long as one of the options does what you need, that's the main thing.
One small thing I noticed in your attachment - on the form 'frmavvio' you can click on the label 'INFORMAZIONI'; I do this quite a lot too but I like to change the cursor from an 'arrow' to a 'hand point' when the user moves the mouse across the label. Maybe it's something you hadn't come across?
Derek.