Skip to main content

Notifications

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

  • 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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans