Ver Mensaje Individual
  #4  
Antiguo 13-03-2010
sizne sizne is offline
Miembro
 
Registrado: mar 2010
Posts: 104
Reputación: 15
sizne Va por buen camino
Me explico, tengo dos Form1 uno es Fprincipal del cual me dirijo a varios formularios. Al q me dirijo es Fregistro. Lo que realizo es lo sigte.
procedure TFprincipal.RegSolicitudClick(Sender: TObject);
begin
Fprincipal.Enabled:=false;
Fregistro.Show;
end;

Luego, estoy en Fregistro donde tengo los campos respectivos(cabe mencionar q los campos las extraje de una tabla q fueron realizadas en SQL Server 2000). En cuanto hago click en el boton "NUEVO", osea aumento un nuevo registro. Me aparece el sigte msj.

Project Pbecarios.exe raised exception class EvarianTypeCastError with message 'Could not convert variant of type (Null) into type ('Double')'. Process stopped. Use Step or Run to continue.
Cuando hago click en RUN o F9 aparece:
Could not convert variant type (Null) into type (Double).
Siendo el código el sigte:

procedure TFRegSolicitud.NuevoEClick(Sender: TObject);
var c:integer;
begin
with DataModule do
begin
if Tregistro.RecordCount=0 then
c:=1
else
c:=Tregistro.RecordCount+1;
end;
DM.Tregistro.Last;
DM.Tregistro.Insert;
DM.Tregistro['IdE']:=c;
DM.Tregistro['NumReg']:='EB-000'+IntToStr(c);
Edit1.Text:=' ';
end;


El campo IdE por si acaso es la llave tipo integer, NumReg tipo de dato string.Al regresa al Fprincipal coloco lo sigte:
procedure TFRegSolicitud.VolverEClick(Sender: TObject);
begin
Fprincipal.Show;
Fprincipal.Enabled:=true;
FregSolicitud.Close;
end;

Y la me fije si algun dato esta invisible del Form Registro y todos estan en true.
Gracias
Responder Con Cita