Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21965

check Date Format

$
0
0
hi i have been asked to write a function that check the length of a date string and to enscure it check the date entered to make sure the first 2 are digits the next 3 or letter last 2 are digits
so someone enters the date 01jan12
need this function to check that its right
have a small bit of it done not sure how to do the checking of the first 2 been number next 3 been letter etc
here is what i have so far
Code:

Private Function checkDateFormat(sTxt As String) As String
    If Len(sTxt) = 7 Then
    Else
        checkDateFormat = sTxt
    End If
End Function

anyone have any idea of the best way to do this

Viewing all articles
Browse latest Browse all 21965


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>