Ver Mensaje Individual
  #2  
Antiguo 28-04-2012
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
O commit o CommitRetaining.

Código Delphi [-]
//utilizamos la función "locate" para realizar la búsqueda
    frmConeccion.Repuesto_vista_02.Locate('CODIGO', txt_arcodigo_repuesto.Text, []);
  if frmConeccion.Repuesto_vista_02CODIGO.Text = txt_arcodigo_repuesto.Text then
    begin
      Application.MessageBox('Este código ya existe, debe crear otro para este registro.', 'Mensaje del sistema', MB_ICONINFORMATION or MB_OK);
     Abort;
    end
  else
  begin
frmConeccion.Repuesto_save2.Post;
frmConeccion.Repuesto_save2.commit; // esto
frmConeccion.Repuesto_save2.Refresh;

o

Código Delphi [-]
//utilizamos la función "locate" para realizar la búsqueda
    frmConeccion.Repuesto_vista_02.Locate('CODIGO', txt_arcodigo_repuesto.Text, []);
  if frmConeccion.Repuesto_vista_02CODIGO.Text = txt_arcodigo_repuesto.Text then
    begin
      Application.MessageBox('Este código ya existe, debe crear otro para este registro.', 'Mensaje del sistema', MB_ICONINFORMATION or MB_OK);
     Abort;
    end
  else
  begin
frmConeccion.Repuesto_save2.Post;
frmConeccion.Repuesto_save2.CommitRetaining; // esto
frmConeccion.Repuesto_save2.Refresh;

Saludos
__________________
Siempre Novato
Responder Con Cita