Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create an ActiveX control (grid) with DataSource and DataMember

Status
Not open for further replies.

ultra2

Programmer
Jun 26, 2005
46
HU
I trying to develop a new data-bound grid activex control. I have placed an unbound grid (no datasource

and datamember properties) onto usercontrol . .
I use variables to store these values:
Dim m_DataSource As Object
Dim m_DataMember As String

Public Property Get DataSource() As DataSource
Set DataSource = m_DataSource
End Property

Public Property Set DataSource(ByVal New_DataSource As DataSource)
set m_DataSource = New_DataSource
PropertyChanged "DataSource"
End Property

Public Property Get DataMember() As String
DataMember = m_DataMember
End Property

Public Property Let DataMember(ByVal New_DataMember As String)
m_DataMember = New_DataMember
PropertyChanged "DataMember"
End Property

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
DataMember = PropBag.ReadProperty("DataMember", "")
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("DataSource", DataSource, Nothing)
Call PropBag.WriteProperty("DataMember", DataMember, "")
End Sub

My questions:
-A normal data-bound grid lists the possible values for DataMember property when the user selected the

DataSource, but mine dont. How could I do this?

-I obtain the recordset in the following way: (to populate data in the grid)
Public WithEvents rst As ADODB.Recordset
Set rst = m_DataSource.Recordsets(m_DataMember)
,but It doesnt work when the DataMember is a "child recordset" of a parent-child relation recordset.

help plz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top