Microsoft KB Archive/910011

= How to obtain custom field information in Accounting Express 2007, Accounting Professional 2007, and Small Business Accounting 2006 by using Visual Basic .NET =

Article ID: 910011

Article Last Modified on 2/7/2007

-

APPLIES TO


 * Microsoft Office Accounting Express 2007
 * Microsoft Office Accounting Professional 2007
 * Microsoft Office Small Business Accounting 2006
 * Microsoft Office Small Business Management Edition 2006

-





INTRODUCTION
This article discusses how to obtain custom field information programmatically in Microsoft Office Accounting Express 2007, Microsoft Office Accounting Professional 2007, and Microsoft Office Small Business Accounting 2006 by using code that is written in Visual Basic .NET.



MORE INFORMATION
Entities such as ICustomerAccount and IVendorAccount have a user field attribute that enables end users to hold custom information about the entities.

To find the user field in Accounting Express 2007, in Accounting Professional 2007, or in Small Business Accounting, follow these steps:
 * 1) Click Vendors, click Vendors in the Find pane, and then click to select a vendor.
 * 2) Click the Custom Fields tab, and then click Customize.
 * 3) In the Customize Form - Vendor dialog box, click a field type, and then specify a field name.
 * 4) Click OK.

After a user field has been added for a specific vendor entity, you can use the following Visual Basic .NET example code to obtain the information programmatically: // SBI is a variable that references the SmallBusinessInstance class. // IUserFields is the interface that holds user-defined custom fields.

Public SBI as New SmallBusinessInstance

SBI.Logon (&quot;Sampleproductcompany&quot;, &quot;SERVERNAME\MICROSOFTSMLBIZ&quot;) MessageBox.Show(&quot;Welcome to Small Business Accounting&quot;, &quot;SBA Add-In&quot;) Catch ex as Exception If TypeOF ex Is System.Exception Then SBI.LogOff MessageBox(&quot;Small Business Accounting is shutting down&quot;, &quot;SBA Add-In&quot;)

End IF

Dim MyVendor As VendorAccount Dim MyStringValue As String

MyVendor = SBI.VendorAccounts.GetByPrimaryKey(366) MyStringValue = MyVendor.UserFields.String1.ToString

MessageBox.Show(MyStringValue)

Keywords: kbhowto kbmbsmigrate KB910011

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.