View Full Version : Block shortcut keys "ctrl -"
OTWarrior
02-10-2010, 02:20 AM
I have just discovered an Access shortcut allowing any user to delete the current active record. The shortcut is ctrl and -
How can I block this? I tried doing it in autokeys and it won't allow it (saying I need to use the sendkeys function to alter it). If I have to do this, I would have to do this on every form. which would not only take time, but make this database slower.
Any one else have a solution to this issue?
I can't find is any other method, you could try Keydown or KeyPress events, but it still requires working on every Form, although you can use a Module for the VBA code.
geekgirlau
02-14-2010, 07:41 PM
If the form is set to not allow deletions, does the keystroke still operate? If not, you don't need to worry about capturing the key combination.
OTWarrior
02-15-2010, 02:13 AM
If the form is set to not allow deletions, does the keystroke still operate? If not, you don't need to worry about capturing the key combination.
Sounds like a good solution (which I didn't think of so thank you), but have tested it and it still deletes the record (which kind of makes that option redundant).
Thanks anyway :)
People, keep 'em coming. I really don't want to have to do this check on every form.
Perhaps you don't have to if you combine a capture Function with the brilliant piece of code posted here http://www.vbaexpress.com/forum/showthread.php?t=30403
See post #16
OTWarrior
02-15-2010, 09:09 AM
Looks promising, but I am unsure how to get it to work in this case, as it isn't the contents of a textbox I am using but a specific command.
Interesting code though...
I think the idea of that method is to have an "empty" Event Procedure on the form (in the text box in the original case) which triggers the Function. It would mean Highlighting all of the Fields and setting the event property for them all in one go. But perhaps it works with the Form's Events as well. As you say it may not be possible to use in your case, which means changing all the forms.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.