ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to tab from option button click (https://www.excelbanter.com/excel-programming/298766-code-tab-option-button-click.html)

Glen Millar

Code to tab from option button click
 
Hi,

I want it so that if someone selects an option button, the tab key will fire
and automatically select the next option based on tab order. BTW, the next
option is a text box.

Private Sub Sub_Catch_Value_Click()
If Sub_Catch_Value = True Then
RainValue.Value = 0
Application.SendKeys ("TAB")
End If
End Sub

But this does not work. It inputs the data into the text box but does not
then select it for input. There must be a better way?

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com



Glen Millar

Code to tab from option button click
 
Hi,

Cracked it.:

Application.SendKeys "{TAB}"

The one I had just sends text.

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com

"Glen Millar" <glen @ powerpointworkbench.com wrote in message
...
Hi,

I want it so that if someone selects an option button, the tab key will

fire
and automatically select the next option based on tab order. BTW, the next
option is a text box.

Private Sub Sub_Catch_Value_Click()
If Sub_Catch_Value = True Then
RainValue.Value = 0
Application.SendKeys ("TAB")
End If
End Sub

But this does not work. It inputs the data into the text box but does not
then select it for input. There must be a better way?

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com





Bob Kilmer[_2_]

Code to tab from option button click
 
Glen,
You can ascertain the tab order and use the SetFocus method of the control
you want to have the focus. Personally, I eschew SendKeys.

Bob

"Glen Millar" <glen @ powerpointworkbench.com wrote in message
...
Hi,

Cracked it.:

Application.SendKeys "{TAB}"

The one I had just sends text.

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com

"Glen Millar" <glen @ powerpointworkbench.com wrote in message
...
Hi,

I want it so that if someone selects an option button, the tab key will

fire
and automatically select the next option based on tab order. BTW, the

next
option is a text box.

Private Sub Sub_Catch_Value_Click()
If Sub_Catch_Value = True Then
RainValue.Value = 0
Application.SendKeys ("TAB")
End If
End Sub

But this does not work. It inputs the data into the text box but does

not
then select it for input. There must be a better way?

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com







Glen Millar

Code to tab from option button click
 
Thanks, Bob. I'll chase up the SetFocus.


--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com

"Bob Kilmer" wrote in message
...
Glen,
You can ascertain the tab order and use the SetFocus method of the control
you want to have the focus. Personally, I eschew SendKeys.

Bob

"Glen Millar" <glen @ powerpointworkbench.com wrote in message
...
Hi,

Cracked it.:

Application.SendKeys "{TAB}"

The one I had just sends text.

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com

"Glen Millar" <glen @ powerpointworkbench.com wrote in message
...
Hi,

I want it so that if someone selects an option button, the tab key

will
fire
and automatically select the next option based on tab order. BTW, the

next
option is a text box.

Private Sub Sub_Catch_Value_Click()
If Sub_Catch_Value = True Then
RainValue.Value = 0
Application.SendKeys ("TAB")
End If
End Sub

But this does not work. It inputs the data into the text box but does

not
then select it for input. There must be a better way?

--

Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
Posted to news://msnews.microsoft.com










All times are GMT +1. The time now is 11:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com