|
-
Aug 12th, 2005, 05:31 AM
#1
Thread Starter
Junior Member
Data Report Problem
I am unable to show the recordset in datareport
Set DataReport1.DataSource = rs
With DataReport1.Sections(3).Controls("Text1").DataField = rs("qt1")
End With
DataReport1.Refresh
it gives error "Item cannot be found in the collection corresponding to the requested name or ordinal"
-
Aug 12th, 2005, 05:37 AM
#2
Re: Data Report Problem
Do you have a field called qt1 in your table?
-
Aug 12th, 2005, 06:55 AM
#3
Thread Starter
Junior Member
Re: Data Report Problem
qt1 is the result of a sql query.
e.g. Select * as qt1 from table
Thanks
-
Aug 12th, 2005, 07:25 AM
#4
Re: Data Report Problem
I think that is the item that is "missing" then. .DataField = rs("something") is looking for "something" to be a field contained within a Db, not a field contained within a recordset object.
-
Aug 12th, 2005, 10:44 AM
#5
Re: Data Report Problem
Your code does not make sense. You are trying to perform a With...End With block on an expression. I am suprised it even compiles.
The DataField property should be set to the name of the field within the recordset, not the field's value.
VB Code:
With DataReport1.Sections(3).Controls("Text1")
.DataField = "qt1"
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|