Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

User Class Shortcut Keys in Terminal Server and VBA Programming

Posted on by Microsoft Employee

Hello:

Recently, I had circulated a question regarding copying a macro file housed within the GP Shortcut Bar to other users.  This shortcut contains the keyboard shortcut of F10 and is used within VBA programming that I created.

It appears that the best way of allowing for other users to have this shortcut, without updating a SQL table, is to place the shortcut within GP User Classes.

The problem is that, especially in our Terminal Server environment, GP Shortcut keyboard keys are limited.  For example, in our test Terminal Server environment, my own GP user ID uses the keyboard shortcut of F10.  Accordingly, the following is my VBA programming for accessing this macro's file:

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

When I try to grant to a User Class access to this shortcut/macro, I cannot use F10.  It does not appear in the Add Shortcut window's drop-down list.

Is there another way of having VBA recognize a macro's file, then?  Or, in the "SendKeys" syntax above, can I specify additional keyboard keystrokes?

Thanks!

John

*This post is locked for comments

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi John

    If you send 3 send keys you only want one action to happen.

    So only one of the key combinations used must be active at a time.  That's why I am suggesting using obscure combinations that a user would not have added themselves.

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    It's GP 2013 R2.

    I'm sorry.  But, what do you mean by "only one of those is active at a time"?

    John

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi John

    What version of GP are you running?

    I tried GP 2010 and GP 2016 and both allowed me to reuse the same shortcut key.

    You could use multiple SendKeys for different function keys as long as only one of those is active at a time.

    Again, I would use a Ctrl-shift or Ctrl-Alt combination that is unlikely to have any other use.

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    When I add a macro shortcut to one class, I'll choose "F10", for example.

    When I attempt to do the same for a second class, "F10" is no longer available for selection in the drop-down list of the macro shortcut window.  So, I have to choose another key, such as "F11".

    I don't have a problem, with doing this.  I just want to make sure that the code that I posted above is not going to display an error in GP for users who are in a class that has, say, "F10".

    I'm just trying to be careful.

    John

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi John

    I was able to add multiple shortcuts using the same shortcut key.

    What is the issue?

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi Dave:

    Will one key combination be allowed for multiple User Class shortcuts?  I'm seeing where GP makes you use a different key or combination, for different classes.  It's a little annoying.

    John

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    As this is a key for programming purposes only, use a Ctrl-shift or Ctrl-Alt combination and make it the same for all.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi Dave:

    Actually, you cannot use the same key in every class.  If you use, say, F10 for one class, that key will not be available to another.

    I'm going to have users test GP, anyway, based on the programming below.  I don't know what else to do.

    It seems to me that, when I tested this last night, it did not work.  It seems to be working, this morning.  But, I don't like situations where I see "sometimes it works, sometimes it doesn't".

    So, I'll have users test this and see how it goes.

    If you do think of anything else, please let me know.  You are, forever and always, "THE MAN"!  John

    Private Sub Redisplay_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)

    SendKeys "{F10}"

    SendKeys "{F11}"

    SendKeys "{F12}"

    End Sub

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi John

    Use the same key for the shortcut in every class and only use that key for this macro.

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: User Class Shortcut Keys in Terminal Server and VBA Programming

    Hi, Dave!

    Actually, about 45 minutes ago, I updated that post with the following.  Please let me know your thoughts:

    My issue is that one user class will press this key, another class will press that key, another class will press another key.

    How do I modify the syntax in VBA to accommodate multiple keys?

    John

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans