2016-02-24

VBA - Object creation example


' Object creation sample
Public Sub CreateCustomer(ByVal firstName As String, ByVal lastName As String, ByVal email As String)
    'Declare a Customer object
    Dim objNewCustomer As Customer
    'Create the new customer
    objNewCustomer.firstName = firstName
    objNewCustomer.lastName = lastName
    objNewCustomer.email = email
    'Add the new customer to the list
    objCustomers.Add (objNewCustomer)
    'Add the new customer to the ListBox control
    lstCustomers.Items.Add (objNewCustomer)
End Sub

No comments:

Post a Comment