RgnChange example for Access 2.0

The following code for the RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

Sub LEAD1_RgnChange ()
    'Declare a local variable.
    Dim MyText As String
    MyText = "Number of pixels in region: "
    MyText = MyText + CStr(ME![LEAD1].OBJECT.GetRgnArea)
    Text1.SetFocus
    Text1.Text = MyText
End Sub