web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Multiple Keys in VBA "SendKeys" Syntax

(0) ShareShare
ReportReport
Posted on by

Hello:

I'm using VBA "SendKeys" syntax, within GP 2013 R2 (12.00.1920).  I want to delineate the end users based on GP User Class and, therefore, their access to macros based on the class that each user is in.  

Each class, by design of GP, has to use a different keystroke to activate the same macro (i.e. the same programming).  

Regardless, for "Class A", F10 will be used.  For "Class B", F11 will be used.  Finally, for "Class C", F12 will be used.

So far, the following is my full syntax:

Private Sub Redisplay_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
SendKeys "{F10}"
End Sub


I would change this to the following:

Private Sub Redisplay_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
SendKeys "{F10}"
SendKeys "{F11}"
SendKeys "{F12}"
End Sub

This won't work, though.  This will simply "press" all three keys when the user's macro runs.

Could someone please share with me the correct syntax?

Thanks!


John

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Multiple Keys in VBA "SendKeys" Syntax

    This is a Terminal Server environment, by the way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans