Userform OK Button doesn't show click on Enter

winxpdows

New Member
Joined
Apr 21, 2011
Messages
24
Hi. I'm looking for help with a commandbutton I have in a Userform that doesn't show the click/down state when using Enter key.

It is a simple OK button for logging in with username/password with code in the ButtonOK_Click sub of the userform. I have it set as the default button so that you can hit Enter and it activates the OK button.

Unfortunately, when you use the Enter button (whether you tab around and set the focus on the OK button or not), it doesn't show the button changing like it's been pressed or pushed down. I would like for the button to show this when you hit Enter, so that it looks like it does when you mouse click it.

Any help is greatly appreciated. I've tried adding do events as the first line of the ButtonOK_Click subroutine, but that doesn't help.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

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