altura = CStr(Nz(rst.Fields("Estatura").Value, 0))
peso = CStr(Nz(rst.Fields("Peso").Value, 0))
If peso = "" Or peso = "0" Or altura = "" Or altura = "0" Then
desc = MsgBox("Los datos de peso o altura del empleado no estan ingresados," & vbCrLf & _
"desea ingresarlos:", vbQuestion + vbYesNo, "DATOS EMPLEADOS")
If desc = vbYes Then
If peso = "" Or peso = "0" Or peso < 0 Then
peso = InputBox("Ingrese el peso(Kgs): ", "Peso")
If StrPtr(peso) = 0 Then
peso = ""
bandP = False
End If
If bandP = True Then
If peso = "" Or Not IsNumeric(peso) Then
peso = Nz(InputBox("El peso ingresado no es valido, ingrese solo numeros, Ingrese el peso(kgs): ", "Peso"), "")
End If
If peso > 201 Then
peso = Nz(InputBox("El peso debe ser menor o igual a 200", "peso"), "")
Exit Sub
End If
If peso < 19 Then
peso = Nz(InputBox("El peso debe ser mayor o igual a 20", "peso"), "")
Exit Sub
End If
End If
pesoC = peso
End If
If altura = "" Or altura = "0" Then
altura = InputBox("Ingrese la Estatura(Mts): ", "Estatura")
If StrPtr(altura) = 0 Then
altura = ""
bandA = False
End If
If bandA = True Then
If altura = "" Or Not IsNumeric(altura) Then
altura = Nz(InputBox("La estatura ingresada no es valida, ingrese solo numeros, Ingrese la estatura(Mts): ", "Estatura"), "")
End If
If altura > 3 Then
altura = Nz(InputBox("La estatura debe ser menor a 3 metros"), "Estatura")
End If
End If
alturaC = altura
End If
'MsgBox "pesoC y alturaC:" & pesoC & alturaC
Else
pesoC = ""
alturaC = ""
End If
End If
Me.txtPesoRegistro.Value = peso
Me.txtAlturaRegistro.Value = altura
cst.Close
rst.Close
dbs.Close
Set rst = Nothing
Set dbs = Nothing
idA = Nz(Me.ID.Value, "")
Set cdbs = CurrentProject.Connection
cdbs.BeginTrans
If Not pesoC = "" Then
mysql = "UPDATE tblEmpleados SET Peso = " & pesoC & " WHERE Num = '" & numO & "'"
cdbs.Execute mysql
MsgBox "El dato de peso del empleado ha sido ingresado correctamente"
End If
If Not alturaC = "" Then
mysql = "UPDATE tblEmpleados SET Estatura = " & alturaC & " WHERE Num = '" & numO & "'"
cdbs.Execute mysql
MsgBox "El dato de estatura del empleado ha sido ingresado correctamente"
End If