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

Codigo formulario Empleados


Enviado por   •  19 de Agosto de 2021  •  Biografías  •  789 Palabras (4 Páginas)  •  47 Visitas

Página 1 de 4

Private Sub Bcerrar_Click() '**** Codigo del Boton Cerrar ****

Unload Me

End Sub

Private Sub Beliminar_Click() '**** Codigo del Boton Eliminar ****

Dim x As Integer

x = MsgBox("Seguro que desea Eliminar este Item?", vbQuestion + vbYesNo, "Eliminar Item")

If x <> vbYes Then Exit Sub

Selection.EntireRow.Delete

ActiveWorkbook.Save

End Sub

Private Sub Bfoto_Click() '**** Codigo del Boton Para buscar la Fotografia ****

On Error Resume Next

archivoimg = Application.GetOpenFilename("Imágenes jpg,*.jpg,Imágenes bmp,*.bmp,Imágenes jpeg,*.jpeg", 0, "Seleccionar Imágen")

Image1.Picture = LoadPicture("")

Image1.Picture = LoadPicture(archivoimg)

Truta = (archivoimg)

If Truta.Text = "FALSO" Then

Truta = Truta2.Text

End If

End Sub

Private Sub bguardar_Click() '**** Codigo del boton Guardar ****

Sheets("Empleados").Activate

   

    Dim fCode As Integer

    fCode = nCode(Cbcode.Text)

   

  If fCode = 0 Then '1

      Do While Not IsEmpty(ActiveCell)

       ActiveCell.Offset(1, 0).Activate ' si el registro no existe, se va al final.

  Loop

   

      With ActiveCell.EntireRow.Font

    .Name = "Calibri"

    .Size = 9

 

  End With

 

  Dim x As Integer

x = MsgBox("Seguro que Desea Ingresar este Empleado? ", vbYesNo, "Ingresar Empleado")

If x <> vbYes Then Exit Sub

    'Aqui es cuando agregamos o modificamos el registro

    Application.ScreenUpdating = False

    ActiveCell = Cbcode

    ActiveCell.Offset(0, 1) = Tnom: ActiveCell.Offset(0, 2) = The: ActiveCell.Offset(0, 3) = Thsa

    ActiveCell.Offset(0, 4) = Val(Tsud.Value): ActiveCell.Offset(0, 5) = Tfecha

    ActiveCell.Offset(0, 6) = Truta

   

   

    Application.ScreenUpdating = True

     

 

    ActiveWorkbook.Save

    Cbcode.Text = Worksheets("Empleados").Range("A2")

   

    Exit Sub

  Else

     Cells(fCode, 2).Select  ' cuando ya existe el registro, cumple esta condición.

 

  End If '1

 

      With ActiveCell.EntireRow.Font

    .Name = "Calibri"

    .Size = 9

 

  End With

  Dim Y As Integer

Y = MsgBox("Seguro que Desea Modificar este Empleado? ", vbYesNo, "Ingresar Empleados")

If Y <> vbYes Then Exit Sub '1

    'Aqui es cuando agregamos o modificamos el registro

    Application.ScreenUpdating = False

    ActiveCell = Cbcode

    ActiveCell.Offset(0, 0) = Tnom: ActiveCell.Offset(0, 1) = The: ActiveCell.Offset(0, 2) = Thsa

    ActiveCell.Offset(0, 3) = Val(Tsud.Value): ActiveCell.Offset(0, 4) = Tfecha:

    ActiveCell.Offset(0, 5) = Truta

   

 

    Application.ScreenUpdating = True

     

 

    ActiveWorkbook.Save

    Cbcode.Text = Worksheets("Empleados").Range("A2")

 

End Sub

'**** Codigo del Cuadro combinado ****

Private Sub Cbcode_Change()

cod.Text = Cbcode.Text

On Error Resume Next

...

Descargar como (para miembros actualizados)  txt (5 Kb)   pdf (31 Kb)   docx (9 Kb)  
Leer 3 páginas más »
Disponible sólo en Clubensayos.com