Link to home
Start Free TrialLog in
Avatar of John Ellis
John Ellis

asked on

VBA "SendKeys" Syntax for Multiple Keystrokes

Hello:

I'm using the VBA "SendKeys" syntax, within an ERP application that segregates end users and their access to macros based on the group that each user is in.  Also, each group has to use a different keystroke to activate the same macro (i.e. the same programming).  (This is, in my opinion, a huge limitation of the application.)

Regardless, for "Group A", F10 will be used.  For "Group B", F11 will be used.  Finally, for "Group 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 envision changing this to the following:

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

Although this seems logical, the only concern that I have is this.  Will each group have all three keys "pressed" at the same time, or would each key correspond to each group of users that I outlined?

Thanks!

John
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Ellis
John Ellis

ASKER

Hello:

Unfortunately, I don't know that my ERP app accommodates that syntax.  We're on Microsoft Dynamics GP 2013 R2 (12.00.1920).

John
Sorry can't help further
Thank you, Mr. Wolfe!

John
John,

 Little lost on this question.  

 Dynamics GP I believe uses Dexterity as it's coding language, but your talking about VBA here.  If you truly are working in VBA, then what Rgonzo1971 posted would work.

  What exactly are you working with?

Jim.
you have to determine which group the user is in and then use the appropriate sendkeys as mentioned before. You may have to check the for where the user group is in the tables and the values for each group