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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Dynamics vba code not always running for some users

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    Tim Foster Profile Picture
    8,515 on at

    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

  • Community Member Profile Picture
    on at

    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?

  • Buffy Riegler Profile Picture
    175 on at

    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
    on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans