Save type info to form : Type « Data Type « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
VBA / Excel / Access / Word » Data Type » Type 
Save type info to form
 
Type CompanyInfo
    SetUpID As Long
    CompanyName As String * 50
    Address As String * 255
    City As String * 50
    StateProvince As String * 20
    PostalCode As String * 20
    Country As String * 50
    PhoneNumber As String * 30
    FaxNumber As String * 30
    DefaultPaymentTerms As String * 255
    DefaultInvoiceDescription As String
End Type

Public typCompanyInfo As CompanyInfo
Sub PopulateControls()
    txtCompanyName.Value = Trim(typCompanyInfo.CompanyName)
    txtAddress.Value = Trim(typCompanyInfo.Address)
    txtCityStateZip.Value = Trim(typCompanyInfo.City", " & _
        Trim(typCompanyInfo.StateProvince& _
        "  " & Format(Trim(typCompanyInfo.PostalCode)"!&&&&&-&&&&")
    txtPhoneFax.Value = "PHONE: " & _
        Format(Trim(typCompanyInfo.PhoneNumber)"(&&&)&&&-&&&&"& _
        "       FAX: " & _
        Format(Trim(typCompanyInfo.FaxNumber)"(&&&)&&&-&&&&")
End Sub

 
Related examples in the same category
1.An Example of Using a Type Structure
2.Create a new data type
3.User-Defined Data Types
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.