Solved

Create custom keyboard shortcuts

Posted on 2011-02-25
16
1,644 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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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
 
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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
ID: 35003447
what are you trying to set the alignment? see my post at http:#a35002812
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 3

Author Comment

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

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
View vs Edit mode enhancements 12 40
T-SQL for SS2000 -- get position of char(13) in a long text field 11 31
ms access 2013, running .mdb 2 31
MS Access Tables Linking 6 42
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now