Hi
within this code
it can be running everywhere in the userform1 content?![]()
Please Login or Register to view this content.
or I must repeat it for every textbox and buttons?
Hi
within this code
it can be running everywhere in the userform1 content?![]()
Please Login or Register to view this content.
or I must repeat it for every textbox and buttons?
Last edited by Undo; 10-11-2021 at 07:13 AM.
You'd have to repeat it, assuming you never need to actually just type a 1 anywhere.
Everyone who confuses correlation and causation ends up dead.
The KeyDown event applies only to the control that has focus. If the userform has no controls, or all it's controls are disabled, it will apply to the userform. So yes, you would have to apply it to all textboxes and buttons.
Please describe what you want to do and we might be able to come up with an alternate approach. You want the user to be able to press "1" and have it cause the same effect as clicking CommandButton1? One way to do this is to set the Accelerator property of the combobox to 1. Then you can click ALT+1 to click that button. It's not quite the same as clicking 1 but it's close.
Jeff
| | |·| |·| |·| |·| | |:| | |·| |·|
Read the rules
Use code tags to [code]enclose your code![/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks