Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox/Userform question
If I show a form which has 3 crucial textboxes that must
have user data in them.....can I return them to an empty textbox before they are permitted to exit? Maybe something like Select Case? Regards. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox/Userform question
Try:
If textbox1.value = "" Then textbox1.setfocus Exit Sub ElseIf textbox2.value = "" Then textbox2.setfocus Exit Sub ElseIf textbox3.value = "" Then textbox3.setfocus Exit Sub End If Let me know if you have any problems. Mark Stuart wrote: If I show a form which has 3 crucial textboxes that must have user data in them.....can I return them to an empty textbox before they are permitted to exit? Maybe something like Select Case? Regards. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox/Userform question
The command to 'activate' a textbox is SetFocus.
Also look at the SelStart and SelLength properties as well to make it even nicer. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... If I show a form which has 3 crucial textboxes that must have user data in them.....can I return them to an empty textbox before they are permitted to exit? Maybe something like Select Case? Regards. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox/Userform question
Many thanks to you both.
Why, when the user is returned to the textbox, does the form not display "from the top"? (Presumably SetFocus controls this action, thus the textbox in question is displayed top left in the window). Can I display the form from the top, by default? Regards. "Mark Bigelow" wrote in message oups.com... Try: If textbox1.value = "" Then textbox1.setfocus Exit Sub ElseIf textbox2.value = "" Then textbox2.setfocus Exit Sub ElseIf textbox3.value = "" Then textbox3.setfocus Exit Sub End If Let me know if you have any problems. Mark Stuart wrote: If I show a form which has 3 crucial textboxes that must have user data in them.....can I return them to an empty textbox before they are permitted to exit? Maybe something like Select Case? Regards. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm TextBox/ComboBox question | Excel Discussion (Misc queries) | |||
Textbox in userform | Excel Programming | |||
combobox/textbox/userform/other question | Excel Programming | |||
Question about ComboBox/Userform/TextBox etc. | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |