Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default TextBox focus 2

I have a userform with two option buttons and a text box.
I want to have the text box always have the focus.
If I click on an un-selected option button, I can give the
text box focus through TextBox1.Setfocus in the click
event of each option button.
But when I click on a selected option button, the click
event for that option button doesn't appear to fire, and
focus changes to the option button.
Is there some way I can keep the focus on TextBox1
for this scenario?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default TextBox focus 2

On a userform? (assume so since you are using setfocus).


how about using the enter event to see if the option button is true and if
so, set the focus to the textbox.

--
Regards,
Tom Ogilvy

"Tim Coddington" wrote in message
...
I have a userform with two option buttons and a text box.
I want to have the text box always have the focus.
If I click on an un-selected option button, I can give the
text box focus through TextBox1.Setfocus in the click
event of each option button.
But when I click on a selected option button, the click
event for that option button doesn't appear to fire, and
focus changes to the option button.
Is there some way I can keep the focus on TextBox1
for this scenario?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default TextBox focus 2

Changing my _Click events to _Enter events did help. Thanks, Tom.
There is another problem. When I am in the text box and press <cr,
(I capture it and process the info in the text box with keypress()), the
text box looses focus. I tried setting focus to TextBox1 in
TextBox1_Exit(), but then, when the form exits, an error is generated.

Any more help available?

"Tom Ogilvy" wrote in message
...
On a userform? (assume so since you are using setfocus).


how about using the enter event to see if the option button is true and if
so, set the focus to the textbox.

--
Regards,
Tom Ogilvy

"Tim Coddington" wrote in message
...
I have a userform with two option buttons and a text box.
I want to have the text box always have the focus.
If I click on an un-selected option button, I can give the
text box focus through TextBox1.Setfocus in the click
event of each option button.
But when I click on a selected option button, the click
event for that option button doesn't appear to fire, and
focus changes to the option button.
Is there some way I can keep the focus on TextBox1
for this scenario?






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
textbox focus Arne Excel Programming 1 June 15th 04 10:44 AM
TextBox Focus Tom Ogilvy Excel Programming 0 June 3rd 04 05:58 PM
TextBox Focus Tom Ogilvy Excel Programming 0 June 3rd 04 04:55 PM
TextBox focus Tom Ogilvy Excel Programming 0 June 3rd 04 03:17 PM
Which textbox have focus? Tom Ogilvy Excel Programming 0 August 27th 03 03:12 PM


All times are GMT +1. The time now is 03:31 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"