Solved

Create custom keyboard shortcuts

Posted on 2011-02-25
16
1,648 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

776 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