' -------------- Form1.FRM Private Sub Command1_Click() Dim MyContact As New Contact MyContact.LastName = Text1.Text MyContact.Find Label5.Caption = MyContact.HomePhone Label6.Caption = MyContact.WorkPhone Label7.Caption = MyContact.MobilePhone End Sub ' ------------- Contact.CLS 'local variable(s) to hold property value(s) Private mvarHomePhone As Variant 'local copy Private mvarWorkPhone As Variant 'local copy Private mvarMobilePhone As Variant 'local copy Private mvarLastName As Variant 'local copy Public Sub Find() Dim oCN As ADODB.Connection Dim oRS As ADODB.Recordset Dim sSql As String: sSql = "" Dim sPath As String: sPath = "C:\Projects\Contacts.MDB" Set oCN = New ADODB.Connection ' Connect to Access MDB oCN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=True;" & _ "Data Source=" & sPath oCN.Open sSql = "Select WorkPhone, HomePhone, MobilePhone from Contacts where LastName='" & Me.LastName & "'" Set oRS = oCN.Execute(sSql) If oRS.EOF Then Me.HomePhone = "Not Found" Me.WorkPhone = Me.HomePhone Me.MobilePhone = Me.HomePhone Else Me.HomePhone = oRS("HomePhone") Me.WorkPhone = oRS("WorkPhone") Me.MobilePhone = oRS("MobilePhone") End If oRS.Close oCN.Close Set oCN = Nothing End Sub Public Property Let LastName(ByVal vData As Variant) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.LastName = 5 mvarLastName = vData End Property Public Property Set LastName(ByVal vData As Variant) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.LastName = Form1 Set mvarLastName = vData End Property Public Property Get LastName() As Variant 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.LastName If IsObject(mvarLastName) Then Set LastName = mvarLastName Else LastName = mvarLastName End If End Property Public Property Let MobilePhone(ByVal vData As Variant) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.MobilePhone = 5 mvarMobilePhone = vData End Property Public Property Set MobilePhone(ByVal vData As Variant) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.MobilePhone = Form1 Set mvarMobilePhone = vData End Property Public Property Get MobilePhone() As Variant 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.MobilePhone If IsObject(mvarMobilePhone) Then Set MobilePhone = mvarMobilePhone Else MobilePhone = mvarMobilePhone End If End Property Public Property Let WorkPhone(ByVal vData As Variant) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.WorkPhone = 5 mvarWorkPhone = vData End Property Public Property Set WorkPhone(ByVal vData As Variant) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.WorkPhone = Form1 Set mvarWorkPhone = vData End Property Public Property Get WorkPhone() As Variant 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.WorkPhone If IsObject(mvarWorkPhone) Then Set WorkPhone = mvarWorkPhone Else WorkPhone = mvarWorkPhone End If End Property Public Property Let HomePhone(ByVal vData As Variant) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.HomePhone = 5 mvarHomePhone = vData End Property Public Property Set HomePhone(ByVal vData As Variant) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.HomePhone = Form1 Set mvarHomePhone = vData End Property Public Property Get HomePhone() As Variant 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.HomePhone If IsObject(mvarHomePhone) Then Set HomePhone = mvarHomePhone Else HomePhone = mvarHomePhone End If End Property this is txt file