Visual Basic - fantasma urgente

Life is soft - evento anual de software empresarial
 
Vista:

fantasma urgente

Publicado por ophio (1 intervención) el 20/06/2006 20:34:29
Creo que tengo un fantasma en mi pc ya que escribo este codigo,con los parametros definifos double y en vez de hacer 2+3=5 me escribe 2+3=23.

Aqui dejo el codigo.

Muchas gracias

Private Sub Text8_Change()

If Text8.Text = "" Then
totalmaterial = 0
If Text9.Text = "" Then
mano = 0
base = totalmaterial + mano
Text7(1).Text = base
Else
mano = Text9.Text
base = totalmaterial + mano
Text7(1).Text = base
End If
Else
totalmaterial = Text8.Text
If Text9.Text = "" Then
mano = 0
base = totalmaterial + mano
Text7(1).Text = base
Else
mano = Text9.Text
base = totalmaterial + mano
Text7(1).Text = base
End If
End If
End Sub

Private Sub Text9_Change()

If Text8.Text = "" Then
totalmaterial = 0
If Text9.Text = "" Then
mano = 0
base = totalmaterial + mano
Text7(1).Text = base
Else
mano = Text9.Text
base = totalmaterial + mano
Text7(1).Text = base
End If
Else
totalmaterial = Text8.Text
If Text9.Text = "" Then
mano = 0
base = totalmaterial + mano
Text7(1).Text = base
Else
mano = Text9.Text
base = totalmaterial + mano
Text7(1).Text = base
End If
End If
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:fantasma urgente

Publicado por ivan (1039 intervenciones) el 20/06/2006 21:59:36
En vez de que pongas esto

mano = Text9.Text
. . . . . .
totalmaterial = Text8.Text

Cámbialo por esto

mano = Val(Text9.Text )
. . . . . .
totalmaterial = Val(Text8.Text )

OBVIAMENTE LAS VARIABLES MANO, TOTALMATERIAL y BASE deben de de ser NUMERICAS

Suerte..!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar