• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 62
  • Last Modified:

How can I use the Autokeys macro with keystrokes of the type Shift and key in Access 2016?

Dear All,

I am trying to set up an Autokeys macro in Access 2016 so that it responds to the keystroke Shift and P. I am setting up the submacro name as +P but I am getting a message saying that the key or key combination +P in Autokeys has invalid syntax or is not alowed (although I have seen it in a few books and tutorials). Could someone please advise how can I use Shift+P in Autokeys?

Regards,
George
0
gkluk
Asked:
gkluk
  • 5
  • 2
  • 2
  • +1
2 Solutions
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
The below screenshot is an example of a AutoKeys macro that uses Shift-F2 to open a custom zoom form (you can see the zoomform on my blog if interested). I don't know if simply adding the curly brackets around the P would make it work, but worth a try.
Autokeys
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I cannot get +<AnyKey> to work for Shift. Error message in all cases.
This is somehow broke.
In at least A2003 ... I had a lot of +<SomeKey>

Meanwhile  ^<AnyKey>  works fine for Control

When you try to Save the AutoKeys Macro ... you get this error message:

error
0
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Your screenshot seems to be using regular parenthesis (), not the curly ones {}. Have you tried with the curly ones? (I don't know if they have an official name in english :) )
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Curly brackets solves the problem for +{F2}   but not +{P} ....  same error.  Tried all sorts of combinations for +<SomeRegularKey>
Very ODD.
0
 
gklukAuthor Commented:
@Anders, unfortunately it does not; I have already tried that (Shift seems to work fine with Function keys but not with individual ones).
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
In at least A2003 ... I used +<SomeKey> all the time.
Not sure when this got broken ... possibly when the Ribbon was introduced in A2007
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I just reported this as a bug ... waiting for response.

@gkluk .... what Version  of Access is this ?  (I'm in A2016 CTR

Also confirmed this in A2010 desktop
0
 
Shane GroffSoftware Design EngineerCommented:
This is not a bug, and the behavior has been this way since at least Access 2007.  I have not verified with Access 2003.

The help topic for Autokeys is here: https://support.office.com/en-us/article/Run-an-Access-macro-by-using-a-keyboard-shortcut-0D267570-D3DA-46EB-9BFB-A3C81AF676BE
It says "These keyboard shortcuts are a subset of the syntax that is used in the SendKeys statement in Microsoft Visual Basic."
And has a list of examples that do work.

It doesn't explicitly say this, but Shift is support ONLY for function keys.

You could request a change in this area via https://access.uservoice.com/, and you could give feedback on the documentation page if you would like to see the documentation updated to more explicitly specify what combinations are supported.

Shane
Access Engineering
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Thanks Shane ...
0
 
gklukAuthor Commented:
@DataBaseMX, I am on Access 2016. It would be good if the documentation included some sort of what is allowed, or a history with references on when things got changed and why as it could be quite demanding and time consuming to find when things changed.
@Shane it might be working as expected by the developer, but a little more documentation would have helped I believe.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now