LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stay in TextBox

Add the text box Exit event to your form:

Private Sub TextBox1_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
If (TextBox1.Text = "invalid input") Then
Cancel = True
End If
End Sub

If you set Cancel to true the cursor is not moved out of
the text box.

-----Original Message-----
In a Form I have a TextBox. When I leave the textBox, I

run a validation of the input.
What I need is to stay in the TextBox, whenever the

validation goes wrong.

In another way whenever the user tab out of the TextBox,

or click on another TextBox in the Form, the Curser must
jump back... or even better... not leave the actual
TextBox.

How to???
.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
How do I get my formula to stay the same BertiesMum New Users to Excel 4 November 20th 05 04:00 PM
Autofit does not stay on. Karen Excel Discussion (Misc queries) 0 October 26th 05 05:02 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"