So salvar se o banco estiver em edição


if dm.Q_funcionarios.State in [DsEdit] then
begin
  dm.Q_funcionarios.Post;
  MessageDlg('Foi salvo com sucesso!',mtInformation,[mbOk],0);
end
else if dm.Q_funcionarios.State in [DsInsert] then
begin
  dm.Q_funcionarios.Post;
  MessageDlg('Foi salvo com sucesso!',mtInformation,[mbOk],0);
end;