home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbof / demonodc.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  41.8 KB  |  1,286 lines

  1. VERSION 4.00
  2. Begin VB.Form CustomerDetailsDBGridNoDataControl 
  3.    Caption         =   "Customer Details (Pure OO example -- no use of the DataControl, SQL, etc.)"
  4.    ClientHeight    =   6030
  5.    ClientLeft      =   630
  6.    ClientTop       =   1170
  7.    ClientWidth     =   8850
  8.    Height          =   6435
  9.    Left            =   570
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6030
  12.    ScaleWidth      =   8850
  13.    Top             =   825
  14.    Width           =   8970
  15.    Begin VB.Frame Frame1 
  16.       Caption         =   "Customer Details"
  17.       Height          =   2535
  18.       Left            =   4320
  19.       TabIndex        =   4
  20.       Top             =   0
  21.       Width           =   3255
  22.       Begin VB.ComboBox lbxGenderCodes 
  23.          Height          =   315
  24.          Left            =   2400
  25.          Sorted          =   -1  'True
  26.          TabIndex        =   8
  27.          Top             =   2160
  28.          Width           =   615
  29.       End
  30.       Begin VB.ComboBox lbxMaritalStatusCodes 
  31.          Height          =   315
  32.          Left            =   1200
  33.          Sorted          =   -1  'True
  34.          TabIndex        =   7
  35.          Top             =   2160
  36.          Width           =   855
  37.       End
  38.       Begin VB.TextBox efSSN 
  39.          Height          =   285
  40.          Left            =   1200
  41.          TabIndex        =   11
  42.          Top             =   1440
  43.          Width           =   1815
  44.       End
  45.       Begin VB.TextBox efLastName 
  46.          Height          =   285
  47.          Left            =   1200
  48.          TabIndex        =   10
  49.          Top             =   1080
  50.          Width           =   1815
  51.       End
  52.       Begin VB.TextBox efFirstName 
  53.          Height          =   285
  54.          Left            =   1200
  55.          TabIndex        =   9
  56.          Top             =   720
  57.          Width           =   1815
  58.       End
  59.       Begin VB.TextBox efDateOfBirth 
  60.          Height          =   285
  61.          Left            =   1200
  62.          TabIndex        =   6
  63.          Top             =   1800
  64.          Width           =   1815
  65.       End
  66.       Begin VB.TextBox efCustomerNumber 
  67.          Height          =   285
  68.          Left            =   1200
  69.          TabIndex        =   5
  70.          Top             =   360
  71.          Width           =   1815
  72.       End
  73.       Begin VB.Label Label1 
  74.          Caption         =   "Marital Status"
  75.          Height          =   255
  76.          Index           =   4
  77.          Left            =   120
  78.          TabIndex        =   56
  79.          Top             =   2160
  80.          Width           =   975
  81.       End
  82.       Begin VB.Label Label1 
  83.          Caption         =   "Sex"
  84.          Height          =   255
  85.          Index           =   11
  86.          Left            =   2040
  87.          TabIndex        =   55
  88.          Top             =   2160
  89.          Width           =   375
  90.       End
  91.       Begin VB.Label Label1 
  92.          Caption         =   "SSN"
  93.          Height          =   255
  94.          Index           =   2
  95.          Left            =   120
  96.          TabIndex        =   16
  97.          Top             =   1440
  98.          Width           =   975
  99.       End
  100.       Begin VB.Label Label1 
  101.          Caption         =   "Last Name"
  102.          Height          =   255
  103.          Index           =   1
  104.          Left            =   120
  105.          TabIndex        =   15
  106.          Top             =   1080
  107.          Width           =   975
  108.       End
  109.       Begin VB.Label Label1 
  110.          Caption         =   "First Name"
  111.          Height          =   255
  112.          Index           =   0
  113.          Left            =   120
  114.          TabIndex        =   14
  115.          Top             =   720
  116.          Width           =   975
  117.       End
  118.       Begin VB.Label Label1 
  119.          Caption         =   "Date Of Birth"
  120.          Height          =   255
  121.          Index           =   3
  122.          Left            =   120
  123.          TabIndex        =   13
  124.          Top             =   1800
  125.          Width           =   975
  126.       End
  127.       Begin VB.Label Label1 
  128.          Caption         =   "Cust Number"
  129.          Height          =   255
  130.          Index           =   12
  131.          Left            =   120
  132.          TabIndex        =   12
  133.          Top             =   360
  134.          Width           =   975
  135.       End
  136.    End
  137.    Begin VB.CommandButton pbAddNewCustomer 
  138.       Caption         =   "Add New"
  139.       Height          =   375
  140.       Left            =   7680
  141.       TabIndex        =   3
  142.       Top             =   120
  143.       Width           =   975
  144.    End
  145.    Begin VB.CommandButton pbUpdateCustomer 
  146.       Caption         =   "Update"
  147.       Height          =   375
  148.       Left            =   7680
  149.       TabIndex        =   2
  150.       Top             =   600
  151.       Width           =   975
  152.    End
  153.    Begin VB.CommandButton pbDeleteCustomer 
  154.       Caption         =   "Delete"
  155.       Height          =   375
  156.       Left            =   7680
  157.       TabIndex        =   1
  158.       Top             =   1080
  159.       Width           =   975
  160.    End
  161.    Begin VB.CommandButton pbOK 
  162.       Cancel          =   -1  'True
  163.       Caption         =   "OK"
  164.       Default         =   -1  'True
  165.       Height          =   375
  166.       Left            =   7680
  167.       TabIndex        =   0
  168.       Top             =   2160
  169.       Width           =   975
  170.    End
  171.    Begin TabDlg.SSTab SSTab1 
  172.       Height          =   3015
  173.       Left            =   0
  174.       TabIndex        =   17
  175.       Top             =   2640
  176.       Width           =   8775
  177.       _Version        =   65536
  178.       _ExtentX        =   15478
  179.       _ExtentY        =   5318
  180.       _StockProps     =   15
  181.       Caption         =   "Addresses"
  182.       TabsPerRow      =   2
  183.       Tab             =   0
  184.       TabOrientation  =   0
  185.       Tabs            =   2
  186.       Style           =   1
  187.       TabMaxWidth     =   0
  188.       TabHeight       =   529
  189.       TabCaption(0)   =   "Addresses"
  190.       Tab(0).ControlCount=   7
  191.       Tab(0).ControlEnabled=   -1  'True
  192.       Tab(0).Control(0)=   "efFormattedAddress"
  193.       Tab(0).Control(1)=   "Label1(13)"
  194.       Tab(0).Control(2)=   "DBGrid2"
  195.       Tab(0).Control(3)=   "pbAddNewAddress"
  196.       Tab(0).Control(4)=   "pbUpdateAddress"
  197.       Tab(0).Control(5)=   "pbDeleteAddress"
  198.       Tab(0).Control(6)=   "Frame2"
  199.       TabCaption(1)   =   "Phones"
  200.       Tab(1).ControlCount=   7
  201.       Tab(1).ControlEnabled=   0   'False
  202.       Tab(1).Control(0)=   "efFormattedPhoneNumber"
  203.       Tab(1).Control(1)=   "Label1(21)"
  204.       Tab(1).Control(2)=   "DBGrid3"
  205.       Tab(1).Control(3)=   "pbAddPhone"
  206.       Tab(1).Control(4)=   "pbUpdatePhone"
  207.       Tab(1).Control(5)=   "pbDeletePhone"
  208.       Tab(1).Control(6)=   "Frame3"
  209.       Begin VB.Frame Frame2 
  210.          Caption         =   "Address Details"
  211.          Height          =   2535
  212.          Left            =   4320
  213.          TabIndex        =   29
  214.          Top             =   360
  215.          Width           =   3255
  216.          Begin VB.TextBox efZipSupplement 
  217.             Height          =   285
  218.             Left            =   2040
  219.             MaxLength       =   4
  220.             TabIndex        =   37
  221.             Top             =   2160
  222.             Width           =   495
  223.          End
  224.          Begin VB.TextBox efZipExtension 
  225.             Height          =   285
  226.             Left            =   2640
  227.             MaxLength       =   2
  228.             TabIndex        =   36
  229.             Top             =   2160
  230.             Width           =   375
  231.          End
  232.          Begin VB.TextBox efZipCode 
  233.             Height          =   285
  234.             Left            =   1200
  235.             MaxLength       =   5
  236.             TabIndex        =   35
  237.             Top             =   2160
  238.             Width           =   735
  239.          End
  240.          Begin VB.TextBox efCity 
  241.             Height          =   285
  242.             Left            =   1200
  243.             TabIndex        =   34
  244.             Top             =   1440
  245.             Width           =   1815
  246.          End
  247.          Begin VB.TextBox efLine3 
  248.             Height          =   285
  249.             Left            =   1200
  250.             TabIndex        =   33
  251.             Top             =   1080
  252.             Width           =   1815
  253.          End
  254.          Begin VB.TextBox efLine2 
  255.             Height          =   285
  256.             Left            =   1200
  257.             TabIndex        =   32
  258.             Top             =   720
  259.             Width           =   1815
  260.          End
  261.          Begin VB.TextBox efLine1 
  262.             Height          =   285
  263.             Left            =   1200
  264.             TabIndex        =   31
  265.             Top             =   360
  266.             Width           =   1815
  267.          End
  268.          Begin VB.ComboBox lbxStateCodes 
  269.             Height          =   315
  270.             Left            =   1200
  271.             Sorted          =   -1  'True
  272.             TabIndex        =   30
  273.             Top             =   1800
  274.             Width           =   1815
  275.          End
  276.          Begin VB.Label Label1 
  277.             Caption         =   "Zip Code"
  278.             Height          =   255
  279.             Index           =   9
  280.             Left            =   120
  281.             TabIndex        =   43
  282.             Top             =   2160
  283.             Width           =   975
  284.          End
  285.          Begin VB.Label Label1 
  286.             Caption         =   "State"
  287.             Height          =   255
  288.             Index           =   8
  289.             Left            =   120
  290.             TabIndex        =   42
  291.             Top             =   1800
  292.             Width           =   975
  293.          End
  294.          Begin VB.Label Label1 
  295.             Caption         =   "City"
  296.             Height          =   255
  297.             Index           =   10
  298.             Left            =   120
  299.             TabIndex        =   41
  300.             Top             =   1440
  301.             Width           =   975
  302.          End
  303.          Begin VB.Label Label1 
  304.             Caption         =   "Line 3"
  305.             Height          =   255
  306.             Index           =   7
  307.             Left            =   120
  308.             TabIndex        =   40
  309.             Top             =   1080
  310.             Width           =   975
  311.          End
  312.          Begin VB.Label Label1 
  313.             Caption         =   "Line 2"
  314.             Height          =   255
  315.             Index           =   6
  316.             Left            =   120
  317.             TabIndex        =   39
  318.             Top             =   720
  319.             Width           =   975
  320.          End
  321.          Begin VB.Label Label1 
  322.             Caption         =   "Line 1"
  323.             Height          =   255
  324.             Index           =   5
  325.             Left            =   120
  326.             TabIndex        =   38
  327.             Top             =   360
  328.             Width           =   975
  329.          End
  330.       End
  331.       Begin VB.CommandButton pbDeleteAddress 
  332.          Caption         =   "Delete"
  333.          Height          =   375
  334.          Left            =   7680
  335.          TabIndex        =   28
  336.          Top             =   1440
  337.          Width           =   975
  338.       End
  339.       Begin VB.CommandButton pbUpdateAddress 
  340.          Caption         =   "Update"
  341.          Height          =   375
  342.          Left            =   7680
  343.          TabIndex        =   27
  344.          Top             =   960
  345.          Width           =   975
  346.       End
  347.       Begin VB.CommandButton pbAddNewAddress 
  348.          Caption         =   "Add New"
  349.          Height          =   375
  350.          Left            =   7680
  351.          TabIndex        =   26
  352.          Top             =   480
  353.          Width           =   975
  354.       End
  355.       Begin VB.Frame Frame3 
  356.          Caption         =   "Address Details"
  357.          Height          =   2535
  358.          Left            =   -70680
  359.          TabIndex        =   21
  360.          Top             =   360
  361.          Width           =   3255
  362.          Begin VB.TextBox efPhoneNumber 
  363.             Height          =   285
  364.             Left            =   1200
  365.             TabIndex        =   23
  366.             Top             =   360
  367.             Width           =   1815
  368.          End
  369.          Begin VB.TextBox efUsage 
  370.             Height          =   285
  371.             Left            =   1200
  372.             TabIndex        =   22
  373.             Top             =   720
  374.             Width           =   1815
  375.          End
  376.          Begin VB.Label Label1 
  377.             Caption         =   "Phone Num"
  378.             Height          =   255
  379.             Index           =   15
  380.             Left            =   120
  381.             TabIndex        =   25
  382.             Top             =   360
  383.             Width           =   975
  384.          End
  385.          Begin VB.Label Label1 
  386.             Caption         =   "Usage"
  387.             Height          =   255
  388.             Index           =   16
  389.             Left            =   120
  390.             TabIndex        =   24
  391.             Top             =   720
  392.             Width           =   975
  393.          End
  394.       End
  395.       Begin VB.CommandButton pbDeletePhone 
  396.          Caption         =   "Delete"
  397.          Height          =   375
  398.          Left            =   -67320
  399.          TabIndex        =   20
  400.          Top             =   1440
  401.          Width           =   975
  402.       End
  403.       Begin VB.CommandButton pbUpdatePhone 
  404.          Caption         =   "Update"
  405.          Height          =   375
  406.          Left            =   -67320
  407.          TabIndex        =   19
  408.          Top             =   960
  409.          Width           =   975
  410.       End
  411.       Begin VB.CommandButton pbAddPhone 
  412.          Caption         =   "Add New"
  413.          Height          =   375
  414.          Left            =   -67320
  415.          TabIndex        =   18
  416.          Top             =   480
  417.          Width           =   975
  418.       End
  419.       Begin MSDBGrid.DBGrid DBGrid2 
  420.          Height          =   1335
  421.          Left            =   120
  422.          OleObjectBlob   =   "DemoNoDC.frx":0000
  423.          TabIndex        =   49
  424.          Top             =   480
  425.          Width           =   4095
  426.       End
  427.       Begin VB.Label Label1 
  428.          Caption         =   "Formatted Address"
  429.          Height          =   255
  430.          Index           =   13
  431.          Left            =   120
  432.          TabIndex        =   48
  433.          Top             =   1800
  434.          Width           =   1575
  435.       End
  436.       Begin VB.Label efFormattedAddress 
  437.          BorderStyle     =   1  'Fixed Single
  438.          ForeColor       =   &H00FF0000&
  439.          Height          =   855
  440.          Left            =   120
  441.          TabIndex        =   47
  442.          Top             =   2040
  443.          Width           =   4095
  444.       End
  445.       Begin MSDBGrid.DBGrid DBGrid3 
  446.          Height          =   1815
  447.          Left            =   -74880
  448.          OleObjectBlob   =   "DemoNoDC.frx":1770
  449.          TabIndex        =   46
  450.          Top             =   480
  451.          Width           =   4095
  452.       End
  453.       Begin VB.Label Label1 
  454.          Caption         =   "Formatted Phone"
  455.          Height          =   255
  456.          Index           =   21
  457.          Left            =   -74880
  458.          TabIndex        =   45
  459.          Top             =   2400
  460.          Width           =   1575
  461.       End
  462.       Begin VB.Label efFormattedPhoneNumber 
  463.          BorderStyle     =   1  'Fixed Single
  464.          ForeColor       =   &H00FF0000&
  465.          Height          =   255
  466.          Left            =   -74880
  467.          TabIndex        =   44
  468.          Top             =   2640
  469.          Width           =   4095
  470.       End
  471.    End
  472.    Begin VB.Label lblPersonDetails 
  473.       AutoSize        =   -1  'True
  474.       BackColor       =   &H00C0C0C0&
  475.       BorderStyle     =   1  'Fixed Single
  476.       Caption         =   "lblPersonDetails"
  477.       ForeColor       =   &H00000080&
  478.       Height          =   255
  479.       Left            =   0
  480.       TabIndex        =   57
  481.       Top             =   5760
  482.       Width           =   8775
  483.       WordWrap        =   -1  'True
  484.    End
  485.    Begin MSDBGrid.DBGrid DBGrid1 
  486.       Height          =   1935
  487.       Left            =   0
  488.       OleObjectBlob   =   "DemoNoDC.frx":2040
  489.       TabIndex        =   54
  490.       Top             =   0
  491.       Width           =   4215
  492.    End
  493.    Begin VB.Label efFormattedName 
  494.       BorderStyle     =   1  'Fixed Single
  495.       ForeColor       =   &H00FF0000&
  496.       Height          =   255
  497.       Left            =   0
  498.       TabIndex        =   53
  499.       Top             =   2280
  500.       Width           =   3495
  501.    End
  502.    Begin VB.Label Label1 
  503.       Caption         =   "Formatted Name"
  504.       Height          =   255
  505.       Index           =   14
  506.       Left            =   0
  507.       TabIndex        =   52
  508.       Top             =   2040
  509.       Width           =   1575
  510.    End
  511.    Begin VB.Label Label1 
  512.       Caption         =   "Age"
  513.       Height          =   255
  514.       Index           =   17
  515.       Left            =   3600
  516.       TabIndex        =   51
  517.       Top             =   2040
  518.       Width           =   375
  519.    End
  520.    Begin VB.Label efAge 
  521.       BorderStyle     =   1  'Fixed Single
  522.       ForeColor       =   &H00FF0000&
  523.       Height          =   255
  524.       Left            =   3600
  525.       TabIndex        =   50
  526.       Top             =   2280
  527.       Width           =   615
  528.    End
  529. Attribute VB_Name = "CustomerDetailsDBGridNoDataControl"
  530. Attribute VB_Creatable = False
  531. Attribute VB_Exposed = False
  532. Option Explicit
  533. ' This example show how the VBOF can
  534. '   support the VB application withouth the need
  535. '   for through conventional VB programming
  536. '   techniques, such as the use of the VB
  537. '   DataControl
  538. '   This example expoits the ability of the
  539. '   VBOFCollection to control
  540. '   VB DBGrid in an object-oriented manner
  541. Private pvtCurrentPerson As Person
  542. Private pvtPersons As VBOFCollection
  543. Private pvtPersonsDBGridWrapper As VBOFDBGridWrapper
  544. Private pvtCurrentAddress As Address
  545. Private pvtAddresses As VBOFCollection
  546. Private pvtAddressesDBGridWrapper As VBOFDBGridWrapper
  547. Private pvtCurrentPhone As Phone
  548. Private pvtPhones As VBOFCollection
  549. Private pvtPhonesDBGridWrapper As VBOFDBGridWrapper
  550. Private pvtStates As VBOFCollection
  551. Private pvtStatesListBoxWrapper As VBOFListBoxWrapper
  552. Private pvtGenderCodes As VBOFCollection
  553. Private pvtGenderCodesListBoxWrapper As VBOFListBoxWrapper
  554. Private pvtMaritalStatusCodes As VBOFCollection
  555. Private pvtMaritalStatusCodesListBoxWrapper As VBOFListBoxWrapper
  556. Public ObjectManager As VBOFObjectManager
  557. Private Sub DisplayPersonalLineage()
  558.     lblPersonDetails = pvtCurrentPerson.PersonalInformation
  559. End Sub
  560. Private Sub DisplayStateCapital()
  561.     If pvtCurrentAddress Is Nothing Then
  562.         Exit Sub
  563.     End If
  564.     If pvtCurrentAddress.State Is Nothing _
  565.     Then
  566.         Exit Sub
  567.     End If
  568.     lblPersonDetails = "Capital city of " & pvtCurrentAddress.State.StateName & " is " & pvtCurrentAddress.State.CapitalCity
  569. End Sub
  570. Private Sub GetDBGridWrappers()
  571.     Set pvtAddresses = _
  572.         New VBOFCollection
  573.     Set pvtPhones = _
  574.         New VBOFCollection
  575. ' attach the Collection, DBGrid and DBGridWrapper
  576.     Set pvtPersonsDBGridWrapper = _
  577.         ObjectManager. _
  578.             NewVBOFDBGridWrapper( _
  579.             Collection:=pvtPersons, _
  580.             DBGrid:=DBGrid1)
  581. ' attach the Collection, DBGrid and DBGridWrapper
  582.     Set pvtAddressesDBGridWrapper = _
  583.         ObjectManager. _
  584.             NewVBOFDBGridWrapper( _
  585.             Collection:=pvtAddresses, _
  586.             DBGrid:=DBGrid2)
  587. ' attach the Collection, DBGrid and DBGridWrapper
  588.     Set pvtPhonesDBGridWrapper = _
  589.         ObjectManager. _
  590.             NewVBOFDBGridWrapper( _
  591.             Collection:=pvtPhones, _
  592.             DBGrid:=DBGrid3)
  593. End Sub
  594. Private Sub DBGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  595.     DisplayPersonalLineage
  596. End Sub
  597. Private Sub DBGrid1_UnboundAddData(ByVal RowBuf As RowBuffer, NewRowBookmark As Variant)
  598.     Dim tempPerson As New Person
  599.     On Local Error Resume Next
  600.     If pvtPersons Is Nothing Then
  601.         Exit Sub
  602.     End If
  603.     Me.MousePointer = vbArrowHourglass
  604. ' add the new Person to the Collection
  605.     pvtPersonsDBGridWrapper. _
  606.         UnboundAddData _
  607.             RowBuf:=RowBuf, _
  608.             NewRowBookmark:=NewRowBookmark, _
  609.             Sample:=tempPerson
  610. ' position to the new Person
  611.     Set pvtCurrentPerson = _
  612.         pvtPersons.MostRecentlyAddedObject
  613.         
  614.     Set pvtPersonsDBGridWrapper.BookmarkObject = _
  615.         pvtCurrentPerson
  616.         
  617.     RefreshCustomerFields
  618.     Me.MousePointer = vbArrow
  619. End Sub
  620. Private Sub DBGrid1_UnboundDeleteRow(Bookmark As Variant)
  621.     On Local Error Resume Next
  622.     If pvtPersons Is Nothing Then
  623.         Exit Sub
  624.     End If
  625.     Me.MousePointer = vbArrowHourglass
  626. ' delete the new Person from the Collection
  627.     pvtPersonsDBGridWrapper. _
  628.         UnboundDeleteRow _
  629.             Bookmark:=Bookmark
  630. ' position to the first Person
  631.     If pvtPersons.Count > 0 Then
  632.         Set pvtCurrentPerson = _
  633.             pvtPersons.Item(1)
  634. MsgBox "Test code here"
  635.         Set pvtPersonsDBGridWrapper.BookmarkObject = _
  636.             pvtCurrentPerson
  637.         
  638.         RefreshCustomerFields
  639.     End If
  640.     Me.MousePointer = vbArrow
  641. End Sub
  642. Private Sub DBGrid1_UnboundWriteData(ByVal RowBuf As RowBuffer, WriteLocation As Variant)
  643.     On Local Error Resume Next
  644.     If pvtPersons Is Nothing Then
  645.         Exit Sub
  646.     End If
  647.     Me.MousePointer = vbArrowHourglass
  648. ' record the updated Person data
  649.     pvtPersonsDBGridWrapper. _
  650.         UnboundWriteData _
  651.             RowBuf:=RowBuf, _
  652.             WriteLocation:=WriteLocation
  653. ' position to the new Person
  654.     Set pvtCurrentPerson = _
  655.         pvtPersonsDBGridWrapper. _
  656.             BookmarkObject
  657.         
  658.     RefreshCustomerFields
  659.     Me.MousePointer = vbArrow
  660. End Sub
  661. Private Sub DBGrid2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  662.     DisplayStateCapital
  663. End Sub
  664. Private Sub DBGrid2_UnboundAddData(ByVal RowBuf As RowBuffer, NewRowBookmark As Variant)
  665.     Dim tempAddress As New Address
  666.     On Local Error Resume Next
  667.     If pvtAddresses Is Nothing Then
  668.         Exit Sub
  669.     End If
  670.     Me.MousePointer = vbArrowHourglass
  671. ' add the new Address to the Collection
  672.     pvtAddressesDBGridWrapper. _
  673.         UnboundAddData _
  674.             RowBuf:=RowBuf, _
  675.             NewRowBookmark:=NewRowBookmark, _
  676.             Sample:=tempAddress
  677. ' position to the new Address
  678.     Set pvtCurrentAddress = _
  679.         pvtAddresses.MostRecentlyAddedObject
  680.     Set pvtAddressesDBGridWrapper.BookmarkObject = _
  681.         pvtCurrentAddress
  682.         
  683.     RefreshAddressFields
  684.     Me.MousePointer = vbArrow
  685. End Sub
  686. Private Sub DBGrid2_UnboundDeleteRow(Bookmark As Variant)
  687.     On Local Error Resume Next
  688.     If pvtAddresses Is Nothing Then
  689.         Exit Sub
  690.     End If
  691.     Me.MousePointer = vbArrowHourglass
  692. ' delete the Address from the Collection
  693.     pvtAddressesDBGridWrapper. _
  694.         UnboundDeleteRow _
  695.             Bookmark:=Bookmark
  696. ' position to the first Address
  697.     If pvtAddresses.Count > 0 Then
  698.         Set pvtCurrentAddress = _
  699.             pvtAddresses.Item(1)
  700. MsgBox "Test code here"
  701.         Set pvtAddressesDBGridWrapper.BookmarkObject = _
  702.             pvtCurrentAddress
  703.         
  704.         RefreshAddressFields
  705.     End If
  706.     Me.MousePointer = vbArrow
  707. End Sub
  708. Private Sub DBGrid2_UnboundWriteData(ByVal RowBuf As RowBuffer, WriteLocation As Variant)
  709.     On Local Error Resume Next
  710.     If pvtAddresses Is Nothing Then
  711.         Exit Sub
  712.     End If
  713.     Me.MousePointer = vbArrowHourglass
  714. ' update the Address in the Collection
  715.     pvtAddressesDBGridWrapper. _
  716.         UnboundWriteData _
  717.             RowBuf:=RowBuf, _
  718.             WriteLocation:=WriteLocation
  719. ' position to the updated Address
  720.     Set pvtCurrentAddress = _
  721.         pvtAddressesDBGridWrapper. _
  722.             BookmarkObject
  723.         
  724.     RefreshAddressFields
  725.     Me.MousePointer = vbArrow
  726. End Sub
  727. Private Sub DBGrid3_UnboundAddData(ByVal RowBuf As RowBuffer, NewRowBookmark As Variant)
  728.     Dim tempPhone As New Phone
  729.     On Local Error Resume Next
  730.     If pvtPhones Is Nothing Then
  731.         Exit Sub
  732.     End If
  733.     Me.MousePointer = vbArrowHourglass
  734. ' add the new Address to the Collection
  735.     pvtPhonesDBGridWrapper. _
  736.         UnboundAddData _
  737.             RowBuf:=RowBuf, _
  738.             NewRowBookmark:=NewRowBookmark, _
  739.             Sample:=tempPhone
  740. ' position to the new Phone
  741.     Set pvtCurrentPhone = _
  742.         pvtPhones.MostRecentlyAddedObject
  743.     pvtPhonesDBGridWrapper.BookmarkObject = _
  744.         pvtCurrentPhone
  745.         
  746.     RefreshPhoneFields
  747.     Me.MousePointer = vbArrow
  748. End Sub
  749. Private Sub DBGrid3_UnboundDeleteRow(Bookmark As Variant)
  750.     On Local Error Resume Next
  751.     If pvtPhones Is Nothing Then
  752.         Exit Sub
  753.     End If
  754.     Me.MousePointer = vbArrowHourglass
  755. ' delete the Phone from the Collection
  756.     pvtPhonesDBGridWrapper. _
  757.         UnboundDeleteRow _
  758.             Bookmark:=Bookmark
  759. ' position to the first Phone
  760.     If pvtPhones.Count > 0 Then
  761.         Set pvtCurrentPhone = _
  762.             pvtPhones.Item(1)
  763.         pvtPhonesDBGridWrapper.BookmarkObject = _
  764.             pvtCurrentPhone
  765.         
  766.         RefreshPhoneFields
  767.     End If
  768.     Me.MousePointer = vbArrow
  769. End Sub
  770. Private Sub DBGrid3_UnboundWriteData(ByVal RowBuf As RowBuffer, WriteLocation As Variant)
  771.     On Local Error Resume Next
  772.     If pvtPhones Is Nothing Then
  773.         Exit Sub
  774.     End If
  775.     Me.MousePointer = vbArrowHourglass
  776. ' update the Phone in the Collection
  777.     pvtPhonesDBGridWrapper. _
  778.         UnboundWriteData _
  779.             RowBuf:=RowBuf, _
  780.             WriteLocation:=WriteLocation
  781. ' position to the updated Phone
  782.     Set pvtCurrentPhone = _
  783.         pvtPhonesDBGridWrapper.BookmarkObject
  784.         
  785.     RefreshPhoneFields
  786.     Me.MousePointer = vbArrow
  787. End Sub
  788. Private Sub efFormattedAddress_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  789.     DisplayStateCapital
  790. End Sub
  791. Private Sub efFormattedName_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  792.     DisplayPersonalLineage
  793. End Sub
  794. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  795.     Me.MousePointer = vbArrowHourglass
  796.     ObjectManager.Form_QueryUnload _
  797.         Me, _
  798.         pvtPersonsDBGridWrapper, _
  799.         pvtAddressesDBGridWrapper, _
  800.         pvtPhonesDBGridWrapper, _
  801.         pvtStatesListBoxWrapper, _
  802.         pvtGenderCodesListBoxWrapper, _
  803.         pvtMaritalStatusCodesListBoxWrapper
  804.     Set pvtPersons = Nothing
  805.     Set pvtAddresses = Nothing
  806.     Set pvtPhones = Nothing
  807.     Set pvtStates = Nothing
  808.     Set pvtGenderCodes = Nothing
  809.     Set pvtMaritalStatusCodes = Nothing
  810. #If NoEventMgr = False Then
  811.     ObjectManager. _
  812.         UnRegisterForAllEvents _
  813.         RegisterObject:=Me
  814. #End If
  815.     Me.MousePointer = vbArrow
  816. End Sub
  817. Public Sub ObjectEventCallBack(Optional Event As Variant, Optional Object As Variant)
  818.     Dim tempObjectType As String
  819.     Dim tempUCaseEvent As String
  820.     On Local Error Resume Next
  821.     tempObjectType = TypeName(Object)
  822.     tempUCaseEvent = UCase$(Event)
  823.     If tempObjectType = "Person" Then
  824.         
  825.         If tempUCaseEvent = "REMOVEDITEM" _
  826.         Or tempUCaseEvent = "REPLACEDITEM" _
  827.         Or tempUCaseEvent = "CHANGED" _
  828.         Then
  829.             pvtPersonsDBGridWrapper.Refresh
  830.             
  831.             If Object.ObjectID = pvtCurrentPerson.ObjectID Then
  832.                 RefreshCustomerFields
  833.             End If
  834.         End If
  835.     End If
  836.     If Not pvtPersonsDBGridWrapper Is Nothing Then
  837.         Set pvtPersonsDBGridWrapper.BookmarkObject = _
  838.             pvtCurrentPerson
  839.     End If
  840.     If tempObjectType = "Address" Then
  841.         RefreshAddressFields
  842.         pvtAddressesDBGridWrapper.Refresh
  843.     End If
  844.     If tempObjectType = "Phone" Then
  845.         RefreshPhoneFields
  846.         pvtPhonesDBGridWrapper.Refresh
  847.     End If
  848. End Sub
  849. Private Sub DBGrid1_UnboundReadData(ByVal RowBuf As RowBuffer, StartLocation As Variant, ByVal ReadPriorRows As Boolean)
  850.     Me.MousePointer = vbArrowHourglass
  851. ' populate the Persons DBGrid
  852.     pvtPersonsDBGridWrapper. _
  853.         UnboundReadData _
  854.             RowBuf:=RowBuf, _
  855.             StartLocation:=StartLocation, _
  856.             ReadPriorRows:=ReadPriorRows
  857.     Me.MousePointer = vbArrow
  858. End Sub
  859. Private Sub RefreshAddressFields()
  860.     On Local Error Resume Next
  861.     If pvtCurrentAddress Is Nothing Or Err = 3021 Then
  862.         efLine1 = ""
  863.         efLine2 = ""
  864.         efLine3 = ""
  865.         efCity = ""
  866.         lbxStateCodes = ""
  867.         efZipCode = ""
  868.         efZipSupplement = ""
  869.         efZipExtension = ""
  870.         efFormattedAddress = ""
  871.         lblPersonDetails = ""
  872.         Exit Sub
  873.     End If
  874.     efLine1 = pvtCurrentAddress.Line1
  875.     efLine2 = pvtCurrentAddress.Line2
  876.     efLine3 = pvtCurrentAddress.Line3
  877.     efCity = pvtCurrentAddress.City
  878.     lbxStateCodes = _
  879.         pvtCurrentAddress.State.StateCode
  880.     efZipCode = pvtCurrentAddress.ZipCode
  881.     efZipSupplement = pvtCurrentAddress.ZipSupplementString
  882.     efZipExtension = pvtCurrentAddress.ZipExtensionString
  883.     efFormattedAddress = pvtCurrentAddress.FormattedAddress
  884. '    DisplayStateCapital
  885. End Sub
  886. Sub RefreshCustomerFields()
  887.     On Local Error Resume Next
  888.         
  889. ' display the person's detail information
  890.     efCustomerNumber = pvtCurrentPerson.CustomerNumber
  891.     efFirstName = pvtCurrentPerson.FirstName
  892.     efLastName = pvtCurrentPerson.LastName
  893.     efSSN = pvtCurrentPerson.SSN
  894.     efDateOfBirth = Format$(pvtCurrentPerson.DateOfBirth, "mm/dd/yyyy")
  895.     lbxMaritalStatusCodes = pvtCurrentPerson.MaritalStatus
  896.     lbxGenderCodes = pvtCurrentPerson.Sex
  897.     efFormattedName = _
  898.         pvtCurrentPerson.FormattedName
  899.     efAge = pvtCurrentPerson.Age
  900.         
  901.     DisplayPersonalLineage
  902. End Sub
  903. Private Sub RefreshPhoneFields()
  904.     On Local Error Resume Next
  905.     If pvtCurrentPhone Is Nothing Or Err = 3021 Then
  906.         efPhoneNumber = ""
  907.         efUsage = ""
  908.         efFormattedPhoneNumber = ""
  909.         Exit Sub
  910.     End If
  911.     efPhoneNumber = pvtCurrentPhone.PhoneNumber
  912.     efUsage = pvtCurrentPhone.Usage
  913.     efFormattedPhoneNumber = pvtCurrentPhone.FormattedPhoneNumber
  914. End Sub
  915. Private Sub RegisterForEvents()
  916. #If NoEventMgr = False Then
  917.     ObjectManager.RegisterForObjectEvent _
  918.         TriggerObjectType:="Person", _
  919.         RegisterObject:=Me
  920.     ObjectManager.RegisterForObjectEvent _
  921.         TriggerObjectType:="Address", _
  922.         RegisterObject:=Me
  923.     ObjectManager.RegisterForObjectEvent _
  924.         TriggerObjectType:="Phone", _
  925.         RegisterObject:=Me
  926.     ObjectManager.RegisterForCollectionEvent _
  927.         Collection:=pvtPersons, _
  928.         RegisterObject:=Me
  929.     ObjectManager.RegisterForCollectionEvent _
  930.         Collection:=pvtAddresses, _
  931.         RegisterObject:=Me
  932.     ObjectManager.RegisterForCollectionEvent _
  933.         Collection:=pvtPhones, _
  934.         RegisterObject:=Me
  935. #End If
  936. End Sub
  937. Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  938.     Dim tempObjectID As Long
  939.     Dim tempBookmark As Variant
  940.     tempBookmark = _
  941.         pvtPersonsDBGridWrapper.Bookmark
  942. ' display the current Person
  943.     If Not IsNull(tempBookmark) Then
  944.         Set pvtCurrentPerson = _
  945.             pvtPersonsDBGridWrapper. _
  946.                 BookmarkObject
  947.             
  948.         RefreshCustomerFields
  949.         
  950. ' set the addresses collection
  951. '   (must rebind the wrapper)
  952.         Set pvtAddresses = _
  953.             pvtCurrentPerson.Addresses
  954.         pvtAddressesDBGridWrapper.Rebind _
  955.             Collection:=pvtAddresses
  956.         If pvtAddresses.Count > 0 Then
  957.             Set pvtCurrentAddress = _
  958.                 pvtAddresses.Item(1)
  959.         End If
  960.         
  961. ' set the phones collection
  962. '   (must rebind the wrapper)
  963.         Set pvtPhones = _
  964.             pvtCurrentPerson.Phones
  965.         pvtPhonesDBGridWrapper.Rebind _
  966.             Collection:=pvtPhones
  967.         If pvtPhones.Count > 0 Then
  968.             Set pvtCurrentPhone = _
  969.                 pvtPhones.Item(1)
  970.         End If
  971.     End If
  972.     DisplayPersonalLineage
  973. End Sub
  974. Private Sub DBGrid2_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  975.     If pvtAddresses Is Nothing Then
  976.         Exit Sub
  977.     End If
  978.     If pvtAddresses.Count <= 0 Then
  979.         Exit Sub
  980.     End If
  981.     Set pvtCurrentAddress = _
  982.         pvtAddressesDBGridWrapper. _
  983.             BookmarkObject
  984.         
  985.     If pvtCurrentAddress Is Nothing Then
  986.         Set pvtCurrentAddress = pvtAddresses.Item(1)
  987.         pvtAddressesDBGridWrapper. _
  988.             BookmarkObject = _
  989.                 pvtCurrentAddress
  990.     End If
  991.         
  992.     RefreshAddressFields
  993. End Sub
  994. Private Sub DBGrid2_UnboundReadData(ByVal RowBuf As RowBuffer, StartLocation As Variant, ByVal ReadPriorRows As Boolean)
  995.     Me.MousePointer = vbArrowHourglass
  996.     If pvtAddresses Is Nothing Then
  997.         Exit Sub
  998.     End If
  999. ' populate the Address DBGrid
  1000.     pvtAddressesDBGridWrapper. _
  1001.         UnboundReadData _
  1002.             RowBuf:=RowBuf, _
  1003.             StartLocation:=StartLocation, _
  1004.             ReadPriorRows:=ReadPriorRows
  1005.     Me.MousePointer = vbArrow
  1006. End Sub
  1007. Private Sub DBGrid3_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  1008.     If pvtPhones Is Nothing Then
  1009.         Exit Sub
  1010.     End If
  1011.     If pvtPhones.Count <= 0 Then
  1012.         Exit Sub
  1013.     End If
  1014.     Set pvtCurrentPhone = _
  1015.         pvtPhonesDBGridWrapper. _
  1016.             BookmarkObject
  1017.         
  1018.     If pvtCurrentPhone Is Nothing Then
  1019.         Set pvtCurrentPhone = pvtPhones.Item(1)
  1020.         
  1021.         Set pvtPhonesDBGridWrapper. _
  1022.             BookmarkObject = _
  1023.                 pvtCurrentPhone
  1024.     End If
  1025.         
  1026.     RefreshPhoneFields
  1027. End Sub
  1028. Private Sub DBGrid3_UnboundReadData(ByVal RowBuf As RowBuffer, StartLocation As Variant, ByVal ReadPriorRows As Boolean)
  1029.     Me.MousePointer = vbArrowHourglass
  1030.     If pvtPhones Is Nothing Then
  1031.         Exit Sub
  1032.     End If
  1033. ' populate the Persons DBGrid
  1034.     pvtPhonesDBGridWrapper. _
  1035.         UnboundReadData _
  1036.             RowBuf:=RowBuf, _
  1037.             StartLocation:=StartLocation, _
  1038.             ReadPriorRows:=ReadPriorRows
  1039.     Me.MousePointer = vbArrow
  1040. End Sub
  1041. Private Sub lbxStateCodes_Click()
  1042.     Dim tempState As State
  1043.     Set tempState = _
  1044.         pvtStates.pvtListBoxSelectObject _
  1045.                 (lbxStateCodes)
  1046. End Sub
  1047. Private Sub Form_Load()
  1048.     Set pvtStates = _
  1049.         pubStates
  1050.     Set pvtGenderCodes = _
  1051.         pubGenderCodes
  1052.     Set pvtMaritalStatusCodes = _
  1053.         pubMaritalStatusCodes
  1054.     Set pvtPersons = _
  1055.         pubPersons
  1056.     GetListBoxWrappers
  1057.     GetDBGridWrappers
  1058.         
  1059.     Set pvtCurrentPerson = _
  1060.         pvtPersons.Item(1)
  1061.     RegisterForEvents
  1062. End Sub
  1063. Private Sub GetListBoxWrappers()
  1064. ' attach the Collection, ListBox and ListBoxWrapper
  1065.     Set pvtStatesListBoxWrapper = _
  1066.         ObjectManager. _
  1067.             NewVBOFListBoxWrapper( _
  1068.             Collection:=pvtStates, _
  1069.             ListBox:=lbxStateCodes)
  1070.     pvtStatesListBoxWrapper. _
  1071.         AddItems
  1072. ' attach the Collection, ListBox and ListBoxWrapper
  1073.     Set pvtGenderCodesListBoxWrapper = _
  1074.         ObjectManager. _
  1075.             NewVBOFListBoxWrapper( _
  1076.             Collection:=pvtGenderCodes, _
  1077.             ListBox:=lbxGenderCodes)
  1078.     pvtGenderCodesListBoxWrapper. _
  1079.         AddItems
  1080. ' attach the Collection, ListBox and ListBoxWrapper
  1081.     Set pvtMaritalStatusCodesListBoxWrapper = _
  1082.         ObjectManager. _
  1083.             NewVBOFListBoxWrapper( _
  1084.             Collection:=pvtMaritalStatusCodes, _
  1085.             ListBox:=lbxMaritalStatusCodes)
  1086.     pvtMaritalStatusCodesListBoxWrapper. _
  1087.         AddItems
  1088. End Sub
  1089. Private Sub pbAddNewAddress_Click()
  1090.     Dim tempNewAddress As New Address
  1091.         
  1092.     On Local Error Resume Next
  1093.     Me.MousePointer = vbArrowHourglass
  1094.     Set pvtCurrentAddress = tempNewAddress
  1095.     PopulateCurrentAddress
  1096.     pvtCurrentPerson.AddAddress _
  1097.         Item:=tempNewAddress
  1098.         
  1099.     pvtAddressesDBGridWrapper.Refresh
  1100.     Set pvtAddressesDBGridWrapper. _
  1101.         BookmarkObject = _
  1102.             pvtCurrentAddress
  1103.     Me.MousePointer = vbArrow
  1104. End Sub
  1105. Private Function PopulateCurrentAddress()
  1106.     On Local Error Resume Next
  1107.     With pvtCurrentAddress
  1108.         .Line1 = efLine1
  1109.         .Line2 = efLine2
  1110.         .Line3 = efLine3
  1111.         .City = efCity
  1112.         .ZipCode = efZipCode
  1113.         .ZipSupplement = efZipSupplement
  1114.         .ZipExtension = efZipExtension
  1115.     End With
  1116.     Set pvtCurrentAddress.State = _
  1117.         pvtStatesListBoxWrapper.ListIndexObject
  1118. End Function
  1119. Private Sub pbAddNewCustomer_Click()
  1120.     Dim tempNewPerson As New Person
  1121.         
  1122.     On Local Error Resume Next
  1123.     Me.MousePointer = vbArrowHourglass
  1124.     Set pvtCurrentPerson = tempNewPerson
  1125.     PopulateCurrentPerson
  1126.     pvtPersons.Add _
  1127.         Item:=tempNewPerson
  1128.             
  1129.     pvtPersonsDBGridWrapper.Refresh
  1130.     Set pvtPersonsDBGridWrapper. _
  1131.         BookmarkObject = _
  1132.             pvtCurrentPerson
  1133.             
  1134.     RefreshCustomerFields
  1135.     Me.MousePointer = vbArrow
  1136. End Sub
  1137. Private Function PopulateCurrentPerson()
  1138.     On Local Error Resume Next
  1139.     With pvtCurrentPerson
  1140.         .CustomerNumber = efCustomerNumber
  1141.         .FirstName = efFirstName
  1142.         .LastName = efLastName
  1143.         .SSN = efSSN
  1144.         .DateOfBirth = DateValue(efDateOfBirth)
  1145.         .Sex = _
  1146.             pvtGenderCodesListBoxWrapper. _
  1147.                 ListIndexObject. _
  1148.                     GenderCode
  1149.         .MaritalStatus = _
  1150.             pvtMaritalStatusCodesListBoxWrapper. _
  1151.                 ListIndexObject. _
  1152.                     MaritalStatusCode
  1153.     End With
  1154. End Function
  1155. Private Sub pbAddPhone_Click()
  1156.     Dim tempNewPhone As New Phone
  1157.         
  1158.     On Local Error Resume Next
  1159.     Me.MousePointer = vbArrowHourglass
  1160.     Set pvtCurrentPhone = tempNewPhone
  1161.     PopulateCurrentPhone
  1162.             
  1163.     pvtCurrentPerson.AddPhone _
  1164.         Item:=tempNewPhone
  1165.         
  1166.     pvtPhonesDBGridWrapper.Refresh
  1167.     Set pvtPhonesDBGridWrapper. _
  1168.         BookmarkObject = _
  1169.             pvtCurrentPhone
  1170.     Me.MousePointer = vbArrow
  1171. End Sub
  1172. Private Function PopulateCurrentPhone()
  1173.     On Local Error Resume Next
  1174.     With pvtCurrentPhone
  1175.         .PhoneNumber = efPhoneNumber
  1176.         .Usage = efUsage
  1177.     End With
  1178. End Function
  1179. Private Sub pbDeleteAddress_Click()
  1180.         
  1181.     On Local Error Resume Next
  1182.     Me.MousePointer = vbArrowHourglass
  1183.     pvtAddresses.Remove _
  1184.         Item:=pvtCurrentAddress
  1185.         
  1186.     DBGrid2.Refresh
  1187.     Me.MousePointer = vbArrow
  1188. End Sub
  1189. Private Sub pbDeleteCustomer_Click()
  1190.         
  1191.     On Local Error Resume Next
  1192.     Me.MousePointer = vbArrowHourglass
  1193.     pvtPersons.Remove _
  1194.         Item:=pvtCurrentPerson
  1195.         
  1196.     DBGrid1.Refresh
  1197.     Me.MousePointer = vbArrow
  1198. End Sub
  1199. Private Sub pbDeletePhone_Click()
  1200.         
  1201.     On Local Error Resume Next
  1202.     Me.MousePointer = vbArrowHourglass
  1203.     pvtPhones.Remove _
  1204.         Item:=pvtCurrentPhone
  1205.         
  1206.     DBGrid3.Refresh
  1207.     Me.MousePointer = vbArrow
  1208. End Sub
  1209. Private Sub pbOK_Click()
  1210.     Unload Me
  1211. End Sub
  1212. Private Sub pbUpdateAddress_Click()
  1213.         
  1214.     On Local Error Resume Next
  1215.     Me.MousePointer = vbArrowHourglass
  1216.     PopulateCurrentAddress
  1217.     pvtAddresses.Replace _
  1218.         Item:=pvtCurrentAddress, _
  1219.         ReplaceWith:=pvtCurrentAddress
  1220.         
  1221. ' trigger the "Changed" event
  1222. ' Note:  This typically a responsibility of the BOM.
  1223. '   But in this demo package, if it were, then the
  1224. '   demo window which is based on the DataControl
  1225. '   would do bunches of database I/O and run for
  1226. '   an extraordinary period.
  1227.     pvtCurrentAddress. _
  1228.         ObjectHasChanged
  1229.     pvtAddressesDBGridWrapper.Refresh
  1230.     Set pvtAddressesDBGridWrapper. _
  1231.         BookmarkObject = _
  1232.             pvtCurrentAddress
  1233.             
  1234.     RefreshAddressFields
  1235.     Me.MousePointer = vbArrow
  1236. End Sub
  1237. Private Sub pbUpdateCustomer_Click()
  1238.         
  1239.     On Local Error Resume Next
  1240.     Me.MousePointer = vbArrowHourglass
  1241.     PopulateCurrentPerson
  1242.     pvtPersons.Replace _
  1243.         Item:=pvtCurrentPerson, _
  1244.         ReplaceWith:=pvtCurrentPerson
  1245. ' trigger the "Changed" event
  1246. ' Note:  This typically a responsibility of the BOM.
  1247. '   But in this demo package, if it were, then the
  1248. '   demo window which is based on the DataControl
  1249. '   would do bunches of database I/O and run for
  1250. '   an extraordinary period.
  1251.     pvtCurrentPerson. _
  1252.         ObjectHasChanged
  1253.     pvtPersonsDBGridWrapper.Refresh
  1254.     Set pvtPersonsDBGridWrapper. _
  1255.         BookmarkObject = _
  1256.             pvtCurrentPerson
  1257.             
  1258.     RefreshCustomerFields
  1259.     Me.MousePointer = vbArrow
  1260. End Sub
  1261. Private Sub pbUpdatePhone_Click()
  1262.         
  1263.     On Local Error Resume Next
  1264.     Me.MousePointer = vbArrowHourglass
  1265.     PopulateCurrentPhone
  1266.     pvtPhones.Replace _
  1267.         Item:=pvtCurrentPhone, _
  1268.         ReplaceWith:=pvtCurrentPhone
  1269.         
  1270. ' trigger the "Changed" event
  1271. ' Note:  This typically a responsibility of the BOM.
  1272. '   But in this demo package, if it were, then the
  1273. '   demo window which is based on the DataControl
  1274. '   would do bunches of database I/O and run for
  1275. '   an extraordinary period.
  1276.     pvtCurrentPhone. _
  1277.         ObjectHasChanged
  1278.     pvtAddressesDBGridWrapper.Refresh
  1279.     Set pvtPhonesDBGridWrapper. _
  1280.         BookmarkObject = _
  1281.             pvtCurrentPhone
  1282.             
  1283.     RefreshPhoneFields
  1284.     Me.MousePointer = vbArrow
  1285. End Sub
  1286.