?
Solved

Create custom keyboard shortcuts

Posted on 2011-02-25
16
Medium Priority
?
1,659 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 1920 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 80 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
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

762 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