Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleBuild an ActiveX control that is bound to a Data control
Keywordsbound control, data, data control, ActiveX, label
CategoriesActiveX, Controls
 
Find the Data control. Save it to a local variable declared WithEvents. When the Reposition event occurs, find the control's value from the Data control's recordset.
 
Private WithEvents m_DataControl As Data

Public Property Let DataControlName(ByVal _
    New_DataControlName As String)
Dim ctl As Control

    m_DataControlName = New_DataControlName
    PropertyChanged "DataControlName"

    ' Find the control.
    For Each ctl In Extender.Parent.Controls
        If ctl.Name = m_DataControlName Then Exit For
    Next ctl
    If Not (ctl Is Nothing) Then Set m_DataControl = ctl
End Property

Private Sub m_DataControl_Reposition()
    If m_DataFieldName <> "" Then
        lblDisplay.Caption = _
            m_DataControl.Recordset.Fields(m_DataFieldName)
    End If
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated