Ver Mensaje Individual
  #6  
Antiguo 02-08-2011
novato_erick novato_erick is offline
Miembro
 
Registrado: ago 2010
Ubicación: Panamá
Posts: 396
Reputación: 14
novato_erick Va por buen camino
Para ser mas claro:

mi procedimiento creado para llamar al formulario Cliente:

Código Delphi [-]
procedure TFrmPrincipal.AgregarExecute(Sender: TObject);
begin
 utiles.MuestraVentana('Clientes','Normal');
end;

luego abre mi formulario en un panel con una pestaña y su debido caption

Código Delphi [-]
procedure MuestraVentana(ventana: string; modo: string);

begin
if ventana = 'Clientes' then
  begin
    if FrmCliente = nil then
    begin
      FrmCliente := TfrmCliente.create(FrmCliente);
      Try
      FrmCliente.Parent := FrmPrincipal.Panel4;
      FrmCliente.Caption := 'Clientes';
      FrmCliente.Show;
      finally
      FrmPrincipal.TabSet1.Tabs.add(FrmCliente.Caption);
      FrmPrincipal.TabSet1.TabIndex := FrmPrincipal.TabSet1.Tabs.Count - 1;
      dmacceso.cdsClientes.Active := True;
      dmacceso.cdsClientes.Edit;
      dmacceso.cdsClientes.ClearFields;
      end;
    end

end;

ahora quiero guardar el registro del cliente

Código Delphi [-]
procedure TfrmCliente.btnGuardarClick(Sender: TObject);
begin
  dmAcceso.cdsClientesPais.Value := cbexPais.text;
  dmAcceso.cdsClientes.ApplyUpdates(0);
  dmAcceso.cdsClientes.Append;
  cbexpais.Text := 'Otro';

  if Application.MessageBox('¿Desea Agregar Otro?', '',
  MB_ICONQUESTION OR MB_YESNO ) = ID_NO then
  begin
    frmcliente.close;
  end;

end;

es correcto lo que hago creo que algo pasa porque me elimina como dije el primer registro si lo abro y si sigo agregando registro me borra es el último. y no quiero eso...


Saludos;
Responder Con Cita