Solved

Create custom keyboard shortcuts

Posted on 2011-02-25
16
1,656 Views
Last Modified: 2012-05-11
Hello,

I'm using Access 2010 and I'd like to assign some keyboard shortcuts to certain build in features such as the align left button.  How can I do this in Access 2010?

Thanks
0
Comment
Question by:eshurak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 2
16 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34985503
you can create a macro and save it as AutoKeys

from  ribbon Create > macro

select submacro from the Add new action drop down
enter ^Q     '< just a sample, this for Ctrl + Q combination
 select Runcode
 in the function name enter  fAlignLeft()


save macro

now create a new module and place this codes

Function fAlignLeft()
docmd.runcommand accmdAlignLeft
end function


test by creating a form and adding textbox, select the textbox and hit CTRL + Q



0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 480 total points
ID: 34985569
correction, you can directly assign AlignLeft without using any function


SubMacro ^Q
    runcommand
        command AlignLeft

end submacro


0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 20 total points
ID: 34999026
For the record there are Hotkey combinations to do this.
For example: Alt+JASAL
...will left align all the selected controls as you specify.
In Design View, tap (press and release) the Alt key then press (and release) JASAL in sequence

Not terribly user friendly, but they do exist...

;-)

JeffCoachman
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 3

Author Comment

by:eshurak
ID: 35001770
Cap1 - I can't get this to work.  If I did would I have to do this in every database that I'm working with or it be made global?


Thanks Jeff, that works and because I added the align left to the QAT it's always the same.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35001867
< If I did would I have to do this in every database that I'm working with or it be made global?>
you have to include the AutoKeys macro for each db
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35002812
btw, where do you use the align left?
 for text in controls or aligning controls in the design view of the form?
0
 
LVL 3

Author Comment

by:eshurak
ID: 35003442
Cap,

I'm still not able to get this to work.  I can't see where find the runcommend is set or how to set the keyboard short cut.

Thanks
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35003447
what are you trying to set the alignment? see my post at http:#a35002812
0
 
LVL 3

Author Comment

by:eshurak
ID: 35003458
I'm attempting to align objects in a form.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35003468
upload a copy of your db..
 also, which key combination do you want to use for this function?  

 CTRL + < what key >
0
 
LVL 3

Author Comment

by:eshurak
ID: 35003484
I don't have a key combo in mind.  Could you just unload a blank db with the macro in it as the is no data involved so I can see the solution.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35003572
the solution is already posted at

http:#a34985503  and http:#a34985569
0
 
LVL 3

Author Comment

by:eshurak
ID: 35010631
Thanks Cap I see that you already posted it but neither runcommand nor alignleft exist.  There is a "RunMenuCommand", but there is no alignment option with that.  I can make it work with code but as I'm going to be moving this to many databases I rather have it all in one place as I'd like to make it work with just the macro and not code.

SubMacro ^Q
    runcommand
        command AlignLeft

end submacro
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35010656
click on Show all actions from the ribbon.
0
 
LVL 3

Author Comment

by:eshurak
ID: 35010939
Awesome, great time saver.  Although I wish MS left customizing keyboard shortcuts the way it is in other apps.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35011092
Yeah, what odd is that in 2007 you had a complete "Alignment" tab, that you could just click to "nudge" the controls left, right, up or down.
It is gone in 2010...
:-(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question