ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cancel return on keyboard (https://www.excelbanter.com/excel-programming/307155-re-cancel-return-keyboard.html)

jaf

Cancel return on keyboard
 
Hi Alvin,
There isn't a built-in event to do that in VBA.

You can create custom events with VBA.
See Event in VBA help.
You would need to raise your event when your conditions are met, or not met.
Then test for the event in the begining of your button code to exit the sub
if the event was (is) raised.

--

John
johnf202 at hotmail dot com



"Alvin Hansen" wrote in message
...
: hi
: I can in a asp/html or whatever
: cancel the effect on the return button
: on the keybord
: So my command button dont work
: with this
: i use
: function cancelEvent() {
: window.event.returnValue=false;
: window.event.cancelBubble=true;
: }
: CAn't i do the same in a userform??
:
: resgards alvin
:



Alvin Hansen[_2_]

Cancel return on keyboard
 
Thank you for your help

Regards alvin


"jaf" skrev:

Hi Alvin,
There isn't a built-in event to do that in VBA.

You can create custom events with VBA.
See Event in VBA help.
You would need to raise your event when your conditions are met, or not met.
Then test for the event in the begining of your button code to exit the sub
if the event was (is) raised.

--

John
johnf202 at hotmail dot com



"Alvin Hansen" wrote in message
...
: hi
: I can in a asp/html or whatever
: cancel the effect on the return button
: on the keybord
: So my command button dont work
: with this
: i use
: function cancelEvent() {
: window.event.returnValue=false;
: window.event.cancelBubble=true;
: }
: CAn't i do the same in a userform??
:
: resgards alvin
:





All times are GMT +1. The time now is 04:19 AM.

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