LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Userform - Move to next textbox field by hitting enter instead

Hi Gary

i just have a question here. how come i can hit enter to move between text
boxes on my form?


There is no commandbutton with Default=true on your form. Those hijack
Enter.

i don't have any code, other than to limit number entry to
a couple of fields.
the EnterKeyBehavior is set to false, which means enter moves the focus to
the next object in the tab order.


I believe it's there to prevent lineshifts in strings where those aren't
wanted. They might as well use the discarded Enters for something useful.
Just guessing.

now, when i get to a frame with checkboxes, enter does nothing and tab

moves
to the next checkbox.


Enter makes no meaning to most other objects, there is no lineshift in a
checkbox. You can write code for it in the same way, either to Tab on

Private Sub CheckBox1_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then KeyCode = 9
End Sub

or to toggle value

Private Sub CheckBox2_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then CheckBox2.Value = Not CheckBox2.Value
End Sub

or whatever you need

Private Sub CheckBox3_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then Call InstallLinux
End Sub

HTH. Best wishes Harald


 
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
move to the right after hitting enter using macros Santa Fe Al Excel Discussion (Misc queries) 2 November 18th 09 07:45 PM
Automatically move to adjacent cells without hitting Enter Doug Excel Discussion (Misc queries) 7 August 11th 09 07:14 PM
Hitting Enter to Move Cursor to the Next Entry Cell Cisnerax Excel Worksheet Functions 3 February 25th 06 11:04 AM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
Cursor not to move when hitting the enter key Alex Martinez Excel Worksheet Functions 1 May 12th 05 05:40 AM


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