Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I set focus back or remained on Textbox? | Excel Programming | |||
How do I get the date entry bar back (at top of sheet)? | Excel Discussion (Misc queries) | |||
How take form based data entry back to main sub? | Excel Programming | |||
How take form based data entry back to main sub? | Excel Programming | |||
Text to Form Textbox and back | Excel Programming |