Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Dynamics vba code not always running for some users

Posted on by 175

We have GP 2015 running on a terminal server.  Intermittently some users are not running the vba code.  If you go to the Customization Window in that session the Microsoft_Dynamics_GP project is not listed.  Other times the same user is accessing the code without issue.

Any ideas would be greatly appreciated!

Buffy Riegler

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics vba code not always running for some users

    I believe we did it within the project GP- > Tools -> Customize -> VB Editor

    We were working on a customization in the sales form. We modified the connection code so appropriate permissions are sought for each user before data is accessed.

    Not sure whether or not your issue is security related.

       Dim objCont As New ADODB.Connection

       Dim SqlQ As New ADODB.Command

       Dim TableIsERS As New ADODB.Recordset

       Set objCont = UserInfoGet.CreateADOConnection()

       objCont.CursorLocation = adUseClient

       objCont.DefaultDatabase = UserInfoGet.IntercompanyID

        If Trim(SalesTransactionEntryDetail.ItemNumber) = "" Then

           Exit Sub

        Else

           CatNo = Trim(SalesTransactionEntryDetail.ItemNumber)

           SqlQ.ActiveConnection = objCont

           SqlQ.CommandText = adCmdText

  • Buffy Riegler Profile Picture
    Buffy Riegler 175 on at
    RE: Dynamics vba code not always running for some users

    Thanks Tim!  We will recreate the ts profile to see if that will solve it.  At this point we are in a testing phase so there is only 1 very active user.  At 1 point when I knew she wasn't accessing the vba code I had another user try it as well and that user successfully ran the code.  I'm not sure that's enough to identify if it's only 1 user.

    At 1 point I as the developer wasn't able to access the code.  I added a random window to the vba code & the entire project reappeared.  I have not had an issue since.   

    Prem, where did you add the additional code?  Since the user is not accessing the vba project at these times, it doesn't seem like I can add it in that project.  It definitely is intermittent for the 1 user.  She is the only regularly active user right now during the testing phase.  The vba code though is very important and would cause issues if it is not running.  Unfortunately it is not obvious to the user that it is not running since mostly what it is doing is recording data in custom tables.

    Thank for the help!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics vba code not always running for some users

    Hello Buffy

    I recently face similar issue with one of the clients except my issue was that vba code worked for some users while it didnt for others - and they were all logging into the same terminal server. The resolution was making some changes to the connection string in the vba code and how it passed user info to SQL. Is this happening for specific users only where it is intermittant?

  • Suggested answer
    Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: Dynamics vba code not always running for some users

    When this happens in our environment, it is usually a corrupt Terminal Services profile.  We delete the user's roaming profile from the server and then we rename the TS Profile in the Terminal Services profile store.  The next time the user logs in these items should be recreated.

    Tim

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans