3 replies
by limbo
You need to create a Public instance of your disconnected recordset, and assign this to your Grid.
Assuming you are using ADO in a class, create a Public property like this.
Public Property Get DataSource() as Variant
Set DataSource = rsPrimary ' your recordset
End Property
Ensure the 'DataSourceBehviour' property of this class is set to 'vbDataSource' at design time.
Now create an instance of the class in the form with the grid, then bind as follows.
Set grdMain.Datasource = ClassInstance.Datasource
And bobs your uncle.
You can expose DataMember in the same fashion, creating an indexed property in the class, which returns the primary recordsets field name property.
by srudolph_
This could work, but it makes the class more complex then I wanted. What I'm doing instead is creating a clone of the recordset to a ADODC control on the form and binding the grid in code.
Thanx for your help
Shawn
by srudolph_
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending