I'm trying to bind the controls of my data report to the corresponding fields in a recordset that I have created in a coded SQL Statement. I can't seem to get the syntax down right. I have the following:
rst2.Open SQLP, SQL, adOpenKeyset, adLockReadOnly
Load DataReport2
Set DataReport2.DataSource = rst2
With DataReport2
.Sections(1).Controls("txtDescription"
= rst2![ChargeCode]
End With
DataReport2.Show
But I get the following error each time:
Run-time error '3265'
Item cannot be found in the collection corresponding to the requested name or ordinal.
How should the syntax be properly written so I can get this report up and running?
Thanks in advance.
rst2.Open SQLP, SQL, adOpenKeyset, adLockReadOnly
Load DataReport2
Set DataReport2.DataSource = rst2
With DataReport2
.Sections(1).Controls("txtDescription"
End With
DataReport2.Show
But I get the following error each time:
Run-time error '3265'
Item cannot be found in the collection corresponding to the requested name or ordinal.
How should the syntax be properly written so I can get this report up and running?
Thanks in advance.