Discussion Locked
0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm using a Multipage userform. I want to specify which page is displayed when the form is openned and I want to specify a particular text box on that page to have the focus with all the text selected. Any help out there?
5 replies
by mikedale
You can set the text box the will have the focus buy using the 'Setfocus' property on the text box.
ie.
TextBox1.SetFocus
If the textbox have the focus this should display that page on the screen.
Hope this helps
Thanks for your answer, Mike, but when I used SetFocus it worked for single forms, but not for multipages. After considerable trial and error, I discovered that it worked in Excel97 but not Excel 2000. As a work-around in Excel 2000, I added Application.SendKeys ("(TAB)") to move to the next textbox, then Application.SendKeys ("+(TAB)") to shift/tab back to the original textbox and that worked.
try setting the TabIndex property of the control to 0.
When a window is opened the control with TabIndex=0 always get the focus.
Actually, I didn't find this technique to work, but I like the idea and I'm going to play with it later. I think the reason might be that I have controls on the main form plus I have 2 multipage form pages on that same main form. I want the initial focus on the first control on the first multipage. I got that result by coding in a TAB then a Reverse TAB upon activating the form. However, I'm going to try your idea to see if the TAB order can be improved for people Tabbing through. Thanks.
This question was closed by the author
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending
2 helpful
26 replies
0 helpful
3 replies
Discussion
Do you think that business directories are relevant to Local SEO And Lead Generation today
0 helpful
16 replies
Question Unanswered
How to Securely Delete Customer Data Backups on Windows?
0 helpful
0 replies
0 helpful
6 replies