Hi Everyone,
First let me say I'm new to VB and to the forum so I wasn't sure if I should attached my problem to a previous thread "[Resolved] data reports with unbound controls" as it was already resolved.
I am using Windows 98, VB6, Access 2000
I created a report (rptResults) with unbound textboxes and want to populate it with records from an ADO recordset.
I used the example from the previous thread and here is my code:
VB Code:
Set RptResults.DataSource = adoResults.Recordset.Datasource With rptResults With .Sections ("Section1").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptTextBox Then .Item(i).DataMember = "" [COLOR=Red].Item(i).DataField = adoResults.Recordset.Fields(i).Name[/COLOR] End If Next i End With End With rptResults.show End Sub
I get the following error:
ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.
The red line is the line generating the error.
Can someone please help?


Reply With Quote
