Results 1 to 2 of 2

Thread: Simple date validation in a text box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    Somebody must have done this!! I need to check a date for validity (going to Access database) and must be entered in the format dd/mm/yy. Has anyone got the code for this? I hate re-inventing the wheel - as well as being lazy!

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316

    Post

    What you want is the isdate function.....
    Here is the help


    ISDATE FUNCTION
    Returns a Boolean value indicating whether an expression can be converted to a date.

    Syntax

    IsDate(expression)

    The expression argument can be any date or string expression recognizable as a date or time.

    Remarks

    IsDate returns True if the expression is a date or can be converted to a valid date; otherwise, it returns False. In Microsoft Windows, the range of valid dates is January 1, 100 A.D. through December 31, 9999 A.D.; the ranges vary among operating systems.


    Example This example uses the IsDate function to determine if an expression can be converted to a date.

    MyDate = "February 12, 1969": YourDate = #2/12/69#: NoDate = "Hello"
    MyCheck = IsDate(MyDate) ' Returns True.
    MyCheck = IsDate(YourDate) ' Returns True.
    MyCheck = IsDate(NoDate) ' Returns False.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width