Ver Mensaje Individual
  #6 (permalink)  
Antiguo 09/03/2011, 13:01
musicale
 
Fecha de Ingreso: marzo-2011
Mensajes: 10
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Volver a realizare una funcion

e probado a meter un boton que sea el que haga el calculo, pero si cambio algun valor y doy en el boton, no hace mas el calculo.

Private Sub calcula_Click()
If Trim(cmbdesc) = "" Then GoTo Nodescuento

If Trim(txtcant) = "" Then
txtcant = "1"
End If
If lblprec = "0" Then
lblprec = Val(txtprecio) * Val(txtcant)
lbldesc = Val(cmbdesc) / 100 * Val(lblprec)
lblrest = Val(lblprec) - Val(lbldesc)
lblttotal = Val(lblprec) - Val(cmbdesc) / 100 * Val(lblprec)

End If

If Not Trim(txtrecv) = "" Then
lbldev = Val(txtrecv) - Val(lblprec) + Val(lbldesc)
End If

Nodescuento:

If Trim(txtcant) = "" Then
txtcant = "1"
End If
If lblprec = "0" Then
lblprec = Val(txtprecio) * Val(txtcant)
lblttotal = Val(txtrecv) - Val(lblprec)
End If

If Not Trim(txtrecv) = "" Then
lbldev = Val(txtrecv) - Val(lblprec)
End If
End Sub

no se que hacer