IsDate Function

Named Arguments

No

Syntax

IsDate(expression)


expression

Use: Required

Data Type: Variant

Variable or expression containing a date or time.

Return Value

Boolean (True or False).

Description

Determines if a variable's value can be converted to a date.

Rules at a Glance

If the expression passed to IsDate is a valid date, True is returned; otherwise, IsDate returns False.

Programming Tips and Gotchas

  • IsDate uses the locale settings of the current Windows system to determine if the value held within the variable is recognizable as a date. Therefore, what is a legal date format on one machine may fail on another.

  • IsDate is particularly useful for validating data input. However, don't use IsDate in the VB text box control's Change event. The Change event is fired with every keystroke, which means that when the user starts to enter the date, the chances are that the date will be invalid until the point at which the user has completed the data entry.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.198.96