How to make a company default per User ID on the login window in Microsoft Great Plains

Article ID: 858897 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

TechKnowledge Content

Summary

This article describes how to use Modifier with Visual Basic for Applications (VBA) to make a company ID default based on the User ID that is using VBA.

More Information

Modify the company login window to default a specific company when a specific user ID is selected.

1. Add the company login window to VBA.
a. Start Great Plains. When the company login window is open, press CTRL+F11 to add the window to the VBA editor.
b. Press SHIFT+F11 to add the User ID and the Company ID fields to VBA: User ID, and the Company ID.
c. Press SHIFT+F11 to stop adding fields to the VBA editor.

2. Start the VBA editor, and then add the following code to the window:
Private Sub Window_AfterOpen()

If UserID = "LESSONUSER1" Then
Company.Value = 1
ElseIf UserID = "LESSONUSER2" Then
Company.Value = 2
End If
End Sub
The Company.Value=1 is the first company in the drop-down list, and Company.Value=2 is the second company in the drop-down list. Replace the LESSONUSER1 and LESSONUSER2 values with your actual user login IDs.

Note The Company.Value field will change if you create new companies. The companies are listed in the login window in alphabetic order. If you add any new companies, you must change the Company.Value number to reflect the change in the drop-down list order.

This article was TechKnowledge Document ID: 29577

Properties

Article ID: 858897 - Last Review: November 2, 2013 - Revision: 6.0
Applies to
  • Microsoft Dynamics GP 9.0
  • Microsoft Business Solutions–Great Plains 8.0
  • Microsoft Business Solutions–Great Plains 7.5
  • Microsoft Great Plains Dynamics 7.0
  • Microsoft Great Plains eEnterprise 7.0
  • Great Plains Dynamics 6.0
  • Great Plains eEnterprise 6.0
  • Modifier with Visual Basic for Applications
Keywords: 
kbnosurvey kbarchive kbmbsmigrate KB858897

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com