2020 Décimo Tecnología e Informática
viernes, 25 de septiembre de 2020
viernes, 21 de agosto de 2020
Combinar los objetos OptionButton y ChecBox
Private Sub
CommandButton1_Click()
Dim VBolsa As Currency, CantBolsas As
Integer, Boni As Currency
Dim PagoProduccion As Currency, NetoPagar As
Currency
If IsNumeric(TextBox2) Then
CantBolsas =
Val(TextBox2)
Else
MsgBox
"La cantidad de bolsas debe ser un numero!", vbExclamation,
"Error"
Exit Sub
End If
If OptionButton1.Value = True Then
VBolsa = 50
ElseIf OptionButton2.Value = True Then
VBolsa = 150
ElseIf OptionButton3.Value = True Then
VBolsa = 200
Else
MsgBox
"Debe seleccionar el tipo de Bolsa!!", vbExclamation,
"Error"
Exit Sub
End If
TextBox3 = VBolsa
PagoProduccion = CantBolsas * VBolsa
TextBox4 = PagoProduccion
If CheckBox1.Value = True Then
If OptionButton5.Value = True Then
Boni = PagoProduccion * 10 / 100
ElseIf OptionButton6.Value = True Then
Boni =
PagoProduccion * 20 / 100
Else
MsgBox
"Debe seleccionar el tipo de empleado!!", vbExclamation,
"Error"
Exit Sub
End If
Else
Boni = 0
End If
TextBox5 =
Boni
NetoPagar =
PagoProduccion + Boni
TextBox6 =
NetoPagar
End Sub
viernes, 14 de agosto de 2020
OptionButton y ChecBox
Private Sub
CommandButton1_Click()
Dim VALORVENTA As Currency, NETOP As Currency, DESCUENTO As Currency, COMI As Currency
If IsNumeric(TextBox2) Then
VALORVENTA
= Val(TextBox2)
Else
MsgBox "El valor venta debe ser
numerico!!", vbCritical, "Error"
Exit Sub
End If
If CheckBox1.Value = True Then
DESCUENTO
= VALORVENTA * 10 / 100
Else
DESCUENTO = 0
End If
NETOP = VALORVENTA - DESCUENTO
TextBox3 = DESCUENTO
TextBox4 = NETOP
If
OptionButton1.Value = True Then
COMI = VALORVENTA * 10 / 100
ElseIf OptionButton2.Value = True Then
COMI = VALORVENTA * 20 / 100
Else
MsgBox "Debe seleccionar el tipo de
empleado!!", vbInformation, "Error"
Exit Sub
End If
TextBox5 = COMI
End Sub










