Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Error on textbox entry - Go back to text box

Hi all,

I have code that check if the entry in a text box is correct..... this code
is using/in the beforeUpdate Event.

It works great, with the exception of the cursor jumping to the next
textbox, if it is an error i would like the cursor to go back to the textbox
with the error for re-entry.

I am batteling to get this !!!
Any help would be apprciated.

--
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Error on textbox entry - Go back to text box

If your code is in the sheet module then

TextBox1.Activate

if your code is in a standard module then

Sheet1.TextBox1.Activate


"Les" wrote:

Hi all,

I have code that check if the entry in a text box is correct..... this code
is using/in the beforeUpdate Event.

It works great, with the exception of the cursor jumping to the next
textbox, if it is an error i would like the cursor to go back to the textbox
with the error for re-entry.

I am batteling to get this !!!
Any help would be apprciated.

--
Les

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Error on textbox entry - Go back to text box

I would use this.

Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)

If TextBox1.Text < "test" Then
Cancel = True

' *******your code here*****

End If

End Sub

Hope this helps. If so please click "yes" below.
--
Cheers,
Ryan


"Les" wrote:

Hi all,

I have code that check if the entry in a text box is correct..... this code
is using/in the beforeUpdate Event.

It works great, with the exception of the cursor jumping to the next
textbox, if it is an error i would like the cursor to go back to the textbox
with the error for re-entry.

I am batteling to get this !!!
Any help would be apprciated.

--
Les

Reply
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
How can I set focus back or remained on Textbox? Tetsuya Oguma Excel Programming 2 March 5th 08 01:30 PM
How do I get the date entry bar back (at top of sheet)? Linzsocal Excel Discussion (Misc queries) 1 July 17th 06 06:17 PM
How take form based data entry back to main sub? Chet Excel Programming 0 May 10th 06 09:40 PM
How take form based data entry back to main sub? Chet Excel Programming 2 May 10th 06 08:47 PM
Text to Form Textbox and back Pat[_11_] Excel Programming 5 January 19th 04 04:10 PM


All times are GMT +1. The time now is 04:22 AM.

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

About Us

"It's about Microsoft Excel"