Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Moving around a userform with enter

Close enough. It's only slightly different from what I had in mind
and ultimately reaches the my goal, for the user to be able to use the
form without using the mouse if they so choose. Thank you.


On May 7, 3:45 pm, "Corey" wrote:
Try:
Option Explicit

Private Sub OptionButton1_Click()
If OptionButton1 < 0 Then TextBox1.SetFocus
End Sub

Private Sub OptionButton2_Click()
If OptionButton2 < 0 Then TextBox1.SetFocus
End Sub

Private Sub OptionButton3_Click()
If OptionButton3 < 0 Then TextBox1.SetFocus
End Sub

Private Sub OptionButton4_Click()
If OptionButton4 < 0 Then TextBox1.SetFocus
End Sub

wrote in message

ups.com...
I have a working userform that I would like to make more user-
friendly. Four option buttons, a text box, OK and Cancel buttons.

I want the user to be able to press enter from the option button that
has the focus and go straight to the textbox without tabbing through
all the other option buttons. Ideally, pressing enter would
automatically "click" that option button but I'm ok with using
spacebar. Then, pressing enter from textbox1 still needs to activate
the OK button (as it currently does). I thought it would look
(partially) like this:

private sub optionbutton1_enter( )
textbox1.default = true
end sub

private sub textbox1_enter( )
commandbutton1.default = true 'commandbutton 1 is the OK
end sub

the error message I get when I run the form reads "Could not set the
default property, member not found." in regards to the option
button_enter, even if I comment out the textbox1_enter section. What
should I be trying?



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
KEEP THE CELL MARKER FROM MOVING DOWN, AFTER ENTER WURSRICH Excel Discussion (Misc queries) 1 February 5th 10 08:43 PM
Moving between cells when enter is pressed woalmoore Excel Discussion (Misc queries) 3 July 18th 08 04:24 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
moving to next cell using "Enter" Joseph Meehan Excel Discussion (Misc queries) 2 July 28th 05 05:26 PM
moving the cell pointer after hitting enter mporter501 Excel Programming 0 April 7th 04 07:36 PM


All times are GMT +1. The time now is 11:51 PM.

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"