Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to disable the command Ctrl + A (select all) in Access 2007. Is that possible?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

You can use this code in Access to catch CTRL+A and ignore it. The downside is you will have to add this to every form you wish to block. (the upside: you don't have to block every form)

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyA And Shift = acCtrlMask Then 'Catch Ctrl+A
        KeyCode = 0 'Suppress keypress 
    End If
End Sub

Add this to the Form > On Key Down Event

IMPORTANT: Scroll to the bottom of the Event list and change Key Preview to Yes.

share|improve this answer
1  
Thanks :) Works excellent! –  Johan Nov 24 '09 at 11:13
add comment
#IfWinActive, ahk_class OMain
^a::Return
#IfWinActive

In the Autohotkey automation language.

Alternatively:

#IfWinActive, ahk_class OMain
^a::MsgBox, Oh god oh god we're all going to die
#IfWinActive
share|improve this answer
    
Where do I put this code? –  Johan Nov 22 '09 at 15:19
    
Install autohotkey, then make a file with the extension .ahk. Run this file (Put it in startup for best results), and try and control-a :) –  Phoshi Nov 22 '09 at 15:35
1  
Sound a bit to complicated. The database should work on different computers, so install something else than just access is not an option. Thanks any way. –  Johan Nov 22 '09 at 15:58
    
You can compile ahk scripts to work without having to install anything, which is less hassle, at least. I don't think you'll find an easier option, but don't give up hope :) –  Phoshi Nov 22 '09 at 16:03
add comment

Create a macro called AutoKeys. In the first column, type ^A, and in the second, choose Beep from the dropdown. This will cause a Beep anytime ^A is pressed anywhere in your app.

If you want to do absolutely nothing (i.e., no BEEP), you'll have to write a function to call that does nothing and call that with the RunCode action.

If you want to allow it in some contexts and not in others, you'd have to write more complicated code for that. I'm not entirely sure what that code would look like as it raises a number of interesting problems.

And, of course, that's a StackOverflow question...

(frankly I think this whole question belonged over there all along, since the answers require either writing coding or creating something code-like, i.e., a macro)

share|improve this answer
add comment

I don't think so. That key combination is the same in most packages (not just MS ones) and is defined at a fairly basic level.

Of course this is where someone else comes in and proved me wrong

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.