problems with text boxes calls

How can I say to VB to re-open the same text box when user put in this txtbox something wrong?
Ie. :
if txtBox.Text < 20 then [reenter the value in the same text box]

tnx for help Settima.
settimaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anthonycCommented:
I'm confused to what you are asking.... but you can use txtBox.setfocus to set the cursor back into that window
0
VbmasterCommented:
The best solution would probably to add a private variable to your form, and add the check in the KeyUp event. If the action is okay the private variable is set to be equal the txtBox.Text, if it's not just set txtBox.Text = {the private variable}.
0
MarineCommented:
Actually its recommended to use Validate EVent of the textbox to ensure that the user input is valid. If so then proceed with the rest of the program. If not then the focus stays on the textbox till the user makes appropriate changes to it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

SonalCommented:
Settima,hope you are using VB6.o..

put your validation code in the validate event of the text box and if the validation does'nt go thro' succesfully put either a msg box or setfocus to the same text box ...or set cancel = true..
 
0
SonalCommented:
Settima,hope you are using VB6.o..

put your validation code in the validate event of the text box and if the validation does'nt go thro' succesfully put either a msg box or setfocus to the same text box ...or set cancel = true..
 
0
vbWayneCommented:
or..
if cint(textbox.text) < 20 then
  msgbox "Sorry, need a number greater than 20. Please enter a correct number."
textbox.text = ""
textbox.setfocus

end if
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.