|
|
Title | Build an ActiveX control that is bound to a Data control |
Keywords | bound control, data, data control, ActiveX, label |
Categories | ActiveX, 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
|
|
|
|
|
|