User Forms Allow Tab Only to Move Between TextBoxes

MarkA99

New Member
Joined
Apr 7, 2011
Messages
9
Hi

Can someone help with this.
I have a customer that has a custom form to input/amend customer details and they want to only allow tabs to move between textboxes and comboboxes. At present if they use the arrow keys and enter a combobox they then change the option and they can't remember what they were originally. Is there a way to only allow tabs and stop the use of arrow keys when moving between form objects?

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I've found out how to solve this problem :cool:.

I've added the following code to each combobox:

Private Sub cboRef_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyUp Then KeyCode = vbNull
If KeyCode = vbKeyDown Then KeyCode = vbNull
If KeyCode = vbKeyLeft Then KeyCode = vbNull
If KeyCode = vbKeyRight Then KeyCode = vbNull
End Sub

Just in case any body has the same query.
 
Upvote 0

Forum statistics

Threads
1,224,562
Messages
6,179,526
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top