Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


isTime function

Posted on 1999-07-12
Medium Priority
Last Modified: 2010-05-02
Anyone got a thorough 'isTime' function?

Need to check for blank times, work on a 24 hour clock basis, check for blatently wrong times (e.g. 25.00 or 12.62). Busy busy busy........

Question by:NikWhitfield
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 10

Accepted Solution

caraf_g earned 300 total points
ID: 1523823
Public Function IsTime(ByVal strTime As String) As Boolean

Dim dattest As Date

On Error Resume Next
dattest = CDate(strTime)
If Err.Number <> 0 Then
    IsTime = False
    Exit Function
End If
If dattest >= 1 Then
    IsTime = False
    Exit Function
End If

IsTime = True

End Function

LVL 10

Expert Comment

ID: 1523824
Can you please tell me in what sense my answer was not quite satisfactory? I don't understand why I got a "B"?
LVL 10

Expert Comment

ID: 1523825
...also, if the code genuinely wasn't perfect, I would have preferred a chance to improve on my answer.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question