Input box

  • Thread starter Thread starter W. Adam
  • Start date Start date
W

W. Adam

I have a form which displays info. On top of it there is a text box for
input box which lets you put number from 1 thu 10.I need to verify that the
number entered by the user is within the range of 1-10. If it isn't, notify
the user and set the focus back to the text box. Do not allow processing to
continue until a valid entry is entered in the textbox.
How can i achive that

Thanks in advance
 
You can rewrite the form class and attach the event of
keydown.It's the best method I think .But it may be go too
far.You can try this:
write the code into the event TextBox_onModify:
if Isnumeric(me.TextBox1.text) then
' this sentense is to verify whether the user's input
is a number.
if cint(me.textbox1.text)>1 and cint(me.textbox1.text)
<10 then
..........' write you program code here
else
msgbox("Please input the number between 1 and 10")
end if
else
msgbox("Please input the number between 1 an d 10")
end if
Sorry for my poor English.
Wish this help.
Best Regards.
 
Back
Top