-
I have a TextBox that accepts only 4 numbers before the user
can click the OK button.
And what do I want to do with this?
I want to check if the number entered in the TextBox is more
than 2 years away(lower) from the actual date's year
How can I do this?
How can I convert the TextBox.Text into
date format.
-
Coming out of the text box, you have string masquerading as
a numeric.
You could compare abs(val(textbox.text) - year(now())) > 2
Is this what you were looking for?
Good Luck
DerFarm
-
You can use the CDate function to convert a string or number value to the date data type.
But before you do that you want to validate that it is valid information that the user entered. You can do that by using the IsDate Function.
And to find out the two year difference you can use the DateDiff function.