Option Explicit
Dim objCurrentCustomer As CCustomer
Public Function Add() As CCustomer
Set objCurrentCustomer = New CCustomer
Me.Show vbModal
Set Add = objCurrentCustomer
Unload Me
End Function
Public Function Edit(objCustomer As CCustomer)
Set objCurrentCustomer = objCustomer
txtLastName = objCurrentCustomer.LastName
txtFirstName = objCurrentCustomer.FirstName
txtMidInitial = objCurrentCustomer.MidInitial
txtCompany = objCurrentCustomer.Company
txtAddress = objCurrentCustomer.Address
txtCity = objCurrentCustomer.City
txtState = objCurrentCustomer.State
txtPostalCode = objCurrentCustomer.PostalCode
txtCountry = objCurrentCustomer.Country
txtPhoneNumber = objCurrentCustomer.PhoneNumber
txtFaxNumber = objCurrentCustomer.FaxNumber
txtEMail = objCurrentCustomer.EMail
Me.Show vbModal
Unload Me
End Function
请问:Public Function Add() As CCustomer,这函数后面接As CCustomer类有什么作用呢,不明白为什么要接As CCustomer?