Hola todos..
Desde el men� ppal creo un form de esta manera, o sea, NO usando el nombre gen�rico que le pone lazarus:
f3:= TfrmListaPropietarios.Create(Self);
try
f3.Showmodal;
finally
f3.Free;
end;Ese form tiene una grilla y botones de agregar, etc.. el cl�sico CRUD La grilla muestra los datos de una consulta llamada qryProp. En el bot�n editar tengo esto:
procedure TfrmListaPropietarios.btnEditarClick(Sender: TObject);
var
fc: TfrmPropietarios;
begin
qryProp.edit;
fc:= TfrmPropietarios.Create(Self);
fc.caption:= 'Modificar registro';
try
if (fc.ShowModal = mrOK) Then
Begin
qryProp.Post;
qryProp.CommitUpdates;
qryProp.ApplyUpdates;
end
else begin
qryProp.Cancel;
qryProp.CancelUpdates;
end;
qryProp.Refresh;
finally
FreeAndNil(fc);
end;
end;No quiero usar en el form de agregar controles enlazados al datasource, sino TEdits comunes y corrientes.
Entonces deber� cambiar un poco esa forma... no usar el edit, post, etc sino grabar los datos usando un update...
Pero... �C�mo hago en el onShow del formulario fc para cargar los datos que ya hay, si no se c�mo se llama el form padre?
porque algo de esto ya no puedo hacer:
edtNombre.text:= ListaPropietarios.qryProp.FieldByName('nombre').asstring;porque ListaPropietarios no fue creado de la manera "tradicional" de usar el nombre gen�rico.
se podr� usar "super" o algo as�?
Se agradece cualquier consejo!
muchas gracias
Saludos...
