Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/10/2008, 19:47
francof2842
 
Fecha de Ingreso: octubre-2008
Mensajes: 8
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Suma de textbox

no se si es la mejor, pero que funciona, funciona a lo mejor necesita un ajuste minimo pero te lo dejo para vos un saludo

Public a As Integer

Private Sub Text1_Change()
If Text1.Text <> "" Then
sumar (Text1.Text) - a
a = Text1.Text
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> "" Then
sumar (Text2.Text) - a
a = Text2.Text
End If
End Sub

Private Sub Text3_Change()
If Text3.Text <> "" Then
sumar (Text3.Text) - a
a = Text3.Text
End If
End Sub

Private Sub Text4_Change()
If Text4.Text <> "" Then
sumar (Text4.Text) - a
a = Text4.Text
End If
End Sub

Private Sub Text5_Change()
If Text5.Text <> "" Then
sumar (Text5.Text) - a
a = Text5.Text
End If
End Sub

Sub sumar(i As Integer)

Text6.Text = Text6.Text + i

End Sub

Private Sub Text1_GotFocus()
Text1.Text = 0
a = 0
End Sub

Private Sub Text2_GotFocus()
Text2.Text = 0
a = 0
End Sub

Private Sub Text3_GotFocus()
Text3.Text = 0
a = 0
End Sub

Private Sub Text4_GotFocus()
Text4.Text = 0
a = 0
End Sub

Private Sub Text5_GotFocus()
Text5.Text = 0
a = 0
End Sub