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.
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.
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:
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
Article ID: 858897 - Last Review: November 2, 2013 - Revision: 6.0
Contact us for more help