Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Codigo Formulario Empleados
Codigo Formulario Empleados
Unload Me
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
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
Sheets("Empleados").Activate
Cells(Cbcode.ListIndex + 2, 1).Select
Tnom = ActiveCell.Offset(0, 1): The = ActiveCell.Offset(0, 2): Thsa = ActiveCell.Offset(0, 3)
Tsud = ActiveCell.Offset(0, 4): Tfecha = ActiveCell.Offset(0, 5)
Truta3 = ActiveCell.Offset(0, 6)
Else
Tnom = "": The = "": Thsa = "": Tsal = 0: Tsud = 0: Tfecha = Date: Truta3 = Truta2.Text
End If
End Sub
Else
Tcod = ""
End If
Cbcode = Tcod
End Sub
Private Sub Tsud_Change() '**** Codigo del textt de sueldo diario para validar que acepte solo numeros
****
If IsNumeric(Tsud.Text) Then
Else
Tsud = ""
End If
End Sub
Next celda
Cbcode.Text = Worksheets("Empleados").Range("A2")
Tfecha = Date
End Sub
nCode = 0
Do While Not IsEmpty(ActiveCell)
If Codigo = ActiveCell Then
nCode = ActiveCell.Row
End If
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True
End Function