5. Programando el Frm_Entrada
Private Sub Form_Load()
End Sub
14/05/2015 Profesor: Francisco Baez
Frm_Entrada.Show
TxtClave.Focus()
‘Para entradas solo presenten valores
TxtHospedaje. ReadOnly = True
TxtServicios. ReadOnly = True
TxtITBIS. ReadOnly = True
TxtSubTotal. ReadOnly = True
TxtTotalNeto. ReadOnly = True
6. Private Sub BtnAceptar_Click()
End Sub
Dim clave As String
clave = “Luisa“
If TxtClave.Text = clave Then
MsgBox ("Bienvenido al sistema")
Frm_Factura.Show
Frm_Entrada.Hide
Else
MsgBox ("Error, vuelva a ingresar clave")
TxtClave.Text = ""
TxtClave.Focus()
End If
Programando el Boton Aceptar
14/05/2015 Profesor: Francisco Baez
7. Programando el Boton Salir
Private Sub BtnCancelar_Click()
End Sub
Me.Close()
14/05/2015 Profesor: Francisco Baez
8. Al hacer clic en calcular se deberá hallar.
Monto de hospedaje:
Días de hospedaje * Pago Día
El pago día será de S/. 50 (Turista) ó
S/. 70 (Embassy)
Monto Servicios:
Será de S/. 20 por cada servicio
Monto total:
Monto de Hospedaje + Monto del Servicio
IGV:
18% del Monto Total
Total a Pagar:
Monto total + IGV
14/05/2015 Profesor: Francisco Baez
9. Programando el Frm_Factura
Private Sub BtnCalcular_Click()
Dim Dias, Telefono, Cable, Bar, Costo As Integer
Dim Hospedaje, Servicio As Integer
Dim SubTotal, Itbis, TotalNeto As Decimal
Dias = Val(TxtDias.Text)
'Calculando el costo de Hospedaje
If RbrTurista.Checked = True Then
costo = 1000
ElseIf RbtEmmbasy.Checked = True Then
costo = 700
End If
Hospedaje = Costo * Dias
TxtHospedaje.Text = hospedaje
Programando el Boton Calcular
14/05/2015 Profesor: Francisco Baez
10. Programando el Frm_Factura
Private Sub BtnCalcular_Click()
'Calculando el total de Servicios
If ChkTelefono.Checked = True Then
Telefono = 400
Else
Telefono = 0
End If
If ChkCable.Checked = True Then
Cable = 300
Else
Cable = 0
End If
If ChkBar.Checked = True Then
Bar = 1800
Else
Bar = 0
End If
Programando el Boton Calcular
14/05/2015 Profesor: Francisco Baez
11. Programando el Frm_Factura
Private Sub BtnCalcular_Click()
End Sub
'Calculando el total de Servicios
Servicio = Telefono + Cable + Bar
TxtServicios.Text = Servicio
'Calculando el SubTotal
SubTotal = Hospedaje + Servicio
TxtSubTotal.Text = SubTotal
'Calculando el Impuesto(ITBIS)
Itbis = SubTotal * 0.18
TxtItbis.Text = Itbis
'Calculando el Total Neto a Pagar
TotalNeto = SubTotal + Itbis
TxtTotalNeto.Text = TotalNeto
Programando el Boton Calcular
14/05/2015 Profesor: Francisco Baez
12. Private Sub BtnNuevo_Click()
End Sub
Programando el Comando Nuevo
TxtDias.Text = ""
TxtHospedaje.Text = ""
TxtServicios.Text = ""
TxtITBIS.Text = ""
TxtSubTotal.Text = ""
TxtTotalNeto.Text = ""
TxtNombre.Text = ""
TxtNombre.Focus()
14/05/2015 Profesor: Francisco Baez
14. Private Sub BtnSalir_Click()
End Sub
Programando el Comando Salir
Dim Repuesta As Integer
Repuesta = MsgBox("Desea salir del sistema?", 4 + 32 + 256, "Salir")
If Repuesta = 6 Then
End
Else
Return
End If
14/05/2015 Profesor: Francisco Baez
15. Programando el Formulario Frm_Autor
Programando el Boton Aceptar
Private Sub BtnAceptar_Click()
End Sub
Frm_Factura.Show
Frm_Autor.Hide
14/05/2015 Profesor: Francisco Baez