Welcome to VBForums

The problem is that you aren't comparing numbers (where 9 < 10), but some characters (where "2" > "111111111111").

What you should do is convert the value in the MaskEd box to a number and compare that to a number, eg:
Code:
If Val(mskAge.Text) < 18 Then
Note that Val will convert without giving any errors - if the user enters something other than a number (eg: "Hello") then Val will simply return 0, or if there is a number followed by text (eg: "23 Hello") it will return the number.

An alternative would be to use CInt, which will give an error if there is anything other than a number, eg:
Code:
If CInt(mskAge.Text) < 18 Then