uso de horas
saludos, tengo un textbox donde le asigno la hora 9:00 AM - 3:00 PM , entonces quiero hacer que un timer se ejecute si esta en ese rango de hora,
gracias
gracias
para validar que la hora sea correcta, por ejemplo en un TextBox:
If Not IsDate(Text1) Then 'La hora no és correcta
If Not IsDate(Text1) Then 'La hora no és correcta
Podrias utilizar dos text separados para cada hora
y el timer lo activarias c/tanto tiempo preguntando si es mayor a text1 y menor a text 2
y para validar las horas
podrias usar algo asi:
valor de text1.text="12:00 pm"
function ValidaHoras()
´valida hora
If Val(Mid(Trim(text1.Text), 1, 2)) > 12 Then
ValidaHoras = False
Exit Function
End If
´valida minutos
If Val(Mid(Trim(text1.Text), 4, 2)) > 59 Then
ValidaHoras = False
Exit Function
End If
ValidaHoras = true
end function
y el timer lo activarias c/tanto tiempo preguntando si es mayor a text1 y menor a text 2
y para validar las horas
podrias usar algo asi:
valor de text1.text="12:00 pm"
function ValidaHoras()
´valida hora
If Val(Mid(Trim(text1.Text), 1, 2)) > 12 Then
ValidaHoras = False
Exit Function
End If
´valida minutos
If Val(Mid(Trim(text1.Text), 4, 2)) > 59 Then
ValidaHoras = False
Exit Function
End If
ValidaHoras = true
end function
