If you do this
'the public sub define is not correct, when you double click on textbox and
go to code add the event onchange
Public sub TextBox_Change(byval sender, byval e)
try
try
if((microsoft.visualbasic.right(cint(e.text),1) <= 2)) and
((microsoft.visualbasic.right(cint(e.text),1) >= 9) then
'if you want to make sure that the user does not have 'a
number larger then 12
if((cint(e.text)< 12) and (cint(e.text)>=2))then
'number betweeen 2 and 12
else
'number not between 2 and 12
me.textbox.text = microsoft.visualbasic.left
(me.textbox.text,(LEN(me.textbox.text)-1))
end if
else
me.textbox.text = microsoft.visualbasic.left
(me.textbox.text,(LEN(me.textbox.text)-1))
end if
end if
catch
'number was not entered
me.textbox.text = microsoft.visualbasic.left
(me.textbox.text,(LEN(me.textbox.text)-1))
end try
catch ex as
end try
end sub