Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Hitting CtrlA in a text box
John S 

3 years ago
A few times now, it seems I've caused problems in my database by reverting to a Windows habit and trying to select all content in a multi-line text box by using the key combination Ctrl+A.

Is there any workable way of reliably suppressing this key combination for the entire form?

Thanks.
Gregory Clancey  @Reply  
    
3 years ago
I find myself using a button or other "on-click" control to setFocus on the TextBox for DoCmd.RunCommand acCmdCopy. I supposed one could put the same code in some event (double-click ??) of the TextBox itself. My habit is to keep the code in a separate control's event.
Kevin Robertson  @Reply  
          
3 years ago
To suppress Ctrl+A for the entire for use the form's KeyDown event.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    If KeyCode = vbKeyA And (Shift And acCtrlMask) <> 0 Then
        KeyCode = 0 ' Suppress Ctrl+A
    End If
    
End Sub


Important: In the Events tab of the Form Properties remember to set Key Preview to Yes.
John S OP  @Reply  

3 years ago
Thanks Kevin and Gregory. I tried Kevin's approach but it didn't work for me. I did find the following approach involving a macro, which seems to work:

Create ==> Macro
Select Submacro when requested to Add new action, then rename it to ^A.
Macro Name = ^A
Macro Action ==> leave blank
Save Macro ==> rename to AutoKeys
Gregory Clancey  @Reply  
    
3 years ago
Thanks, John. Looks interesting. I haven't tried the earlier technique yet, but yours looks more my speed. I don't know much about macros -- I never use them. Does anyone know it's VBA equivalent?
Gregory Clancey  @Reply  
    
3 years ago
I've not tried this, but I wonder if you could include an ampersand in the TextBox label to provide a keyboard shortcut way of selecting the field value which could then be "Cntrl-C copied" for pasting elsewhere?
John S OP  @Reply  

3 years ago
I'm hesitant to mess around any more with this, now that it seems to be working for me. (I don't use macros much.)
Kevin Robertson  @Reply  
          
3 years ago
John,

If you are worried about messing up what you already have, make a copy of your form and work on that if you need to do some testing. I do this all the time.
Gregory Clancey  @Reply  
    
3 years ago
Good advice, KR. Ctrl-C in the Navigation Pane, Ctrl-V in the empty build area. Leave the default "Copy of . . ." title as is. Work, then, on this new Form listed in the NavPane. After noodling around, this may be deleted without affecting any of the associated source tables or queries whatsoever.
John S OP  @Reply  

3 years ago
Thanks again for your help.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 2:02:16 AM. PLT: 1s