Results 1 to 5 of 5

Thread: Data Report Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2005
    Posts
    23

    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"

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Data Report Problem

    Do you have a field called qt1 in your table?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2005
    Posts
    23

    Re: Data Report Problem

    qt1 is the result of a sql query.

    e.g. Select * as qt1 from table

    Thanks

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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:
    1. With DataReport1.Sections(3).Controls("Text1")
    2.    .DataField = "qt1"
    3. 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
  •  



Click Here to Expand Forum to Full Width