Public Property Get CustomerID() As String CustomerID = rs("CustomerID") End Property Public Property Let CustomerID(NewValue As String) rs("CustomerID") = NewValue End Property |
ObjectName.CustomerID = "HALFI" |
ObjectName.CustomerID = "HALFISTORE" |
Public Property Get CustomerID() As String CustomerID = rs("CustomerID") End Property Public Property Let CustomerID(NewValue As String) 'If the length of NewValue is greater than five If Len(NewValue) > 5 Then '... then raise an error to the program 'using this class Err.Raise vbObjectError + 1, "CustomerID", _"Customer ID can only be up to five " & _"characters long!" Else '... otherwise, change the field value rs("CustomerID") = NewValue End If End Property |
Public Sub Update() rs.Update End Sub |