ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Código de programación


Enviado por   •  20 de Junio de 2023  •  Apuntes  •  1.120 Palabras (5 Páginas)  •  22 Visitas

Página 1 de 5

Option Explicit

Private NoDECASA As Range

Sub mostrarformulario()

    bd_vr.Show

End Sub

Sub cancelar()

    Unload bd_vr

End Sub

Sub limpiar()

    bd_vr.codigo.Text = ""

    bd_vr.nombre.Text = ""

    bd_vr.a_paterno.Text = ""

    bd_vr.a_materno.Text = ""

    bd_vr.cel_colono.Text = ""

    bd_vr.tel_colono.Text = ""

    bd_vr.emergencia.Text = ""

    bd_vr.cel_emergencia.Text = ""

    bd_vr.nombre_conyugue.Text = ""

    bd_vr.ap_conyugue.Text = ""

    bd_vr.cel_conyugue.Text = ""

    bd_vr.dueño.Value = False

    bd_vr.renta.Value = False

    bd_vr.foto.Picture = LoadPicture("")

   

End Sub

Sub guardar()

  Dim RNoDECASA As Range

  Dim NuevaF As Range

 

  If bd_vr.codigo.Text = "" Or bd_vr.nombre.Text = "" Or bd_vr.a_paterno.Text = "" Or _

  bd_vr.a_materno.Text = "" Or bd_vr.cel_colono.Text = "" Or bd_vr.tel_colono.Text = "" Or _

  bd_vr.emergencia.Text = "" Or bd_vr.cel_emergencia.Text = "" Or bd_vr.nombre_conyugue.Text = "" Or _

  bd_vr.ap_conyugue.Text = "" Or bd_vr.cel_conyugue.Text = "" Or _

  (bd_vr.dueño.Value = False And bd_vr.renta.Value = False) Then

   

  MsgBox "Todos lo Campos son Obligatorios."

 

  Else

 

  Set RNoDECASA = Hoja1.ListObjects("BD_TABLA").ListColumns(1).Range

  Set NoDECASA = RNoDECASA.Find(What:=bd_vr.codigo.Text, _

                                  after:=Hoja1.Range("B4"), _

                                   lookat:=xlWhole)

  If NoDECASA Is Nothing Then

     Set NuevaF = Hoja1.ListObjects("BD_TABLA").ListRows.Add(1).Range

     NuevaF.Cells(1).Value = bd_vr.codigo.Text

     NuevaF.Cells(2).Value = bd_vr.nombre.Text

     NuevaF.Cells(3).Value = bd_vr.a_paterno.Text

     NuevaF.Cells(4).Value = bd_vr.a_materno.Text

     NuevaF.Cells(5).Value = bd_vr.cel_colono.Text

     NuevaF.Cells(6).Value = bd_vr.tel_colono.Text

     NuevaF.Cells(8).Value = bd_vr.emergencia.Text

     NuevaF.Cells(9).Value = bd_vr.cel_emergencia.Text

     NuevaF.Cells(10).Value = bd_vr.nombre_conyugue.Text

     NuevaF.Cells(11).Value = bd_vr.ap_conyugue.Text

     NuevaF.Cells(12).Value = bd_vr.cel_conyugue.Text

     If bd_vr.dueño.Value = True Then

          NuevaF.Cells(7).Value = "Propietario"

     Else

          NuevaF.Cells(7).Value = "Renta"

     End If

     

  Else

    MsgBox "El Código ya Existe."

   

  End If

  End If

    Call omar.limpiar

End Sub

Sub buscar()

       Dim RNoDECASA As Range

       Dim ruta As String

       On Error GoTo Depurar

 

     

      If bd_vr.codigo.Text = "" Then

          MsgBox "Escriba un Código."

      Else

          Set RNoDECASA = Hoja1.ListObjects("BD_TABLA").ListColumns(1).Range

         

          Set NoDECASA = RNoDECASA.Find(What:=bd_vr.codigo.Text, _

                                  after:=Hoja1.Range("B4"), _

...

Descargar como (para miembros actualizados)  txt (4 Kb)   pdf (33 Kb)   docx (8 Kb)  
Leer 4 páginas más »
Disponible sólo en Clubensayos.com