Results 1 to 3 of 3

Thread: vb6.0 datareport

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    2

    vb6.0 datareport

    Code:
     strSQL = "select model from  furobj"       
           
           Set rec = conn.Execute(strSQL)
         
            Load DataReport2
           Set DataReport2.DataSource = rec      
            
           DataReport2.Sections(3).Controls.Item("Label1").Caption = rec.Fields(0).Value       
         
           DataReport2.Show
    i wanted to show all records in datareport but the datareport shows only one record and is printed many times

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: vb6.0 datareport

    That SQL statement will return the "model" from every record in the "furobj" table. Test whats in "rec"

    Code:
    do while Not rec.EOF
        msgbox rec!model
        rec.Movenext
    Loop

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

    Re: vb6.0 datareport

    rptLabel controls are not Bound controls. Only data from the first record will be loaded into the Label Caption.

    Use an rptText control and bind it to the recordset by setting it's DataField property to the name of the recordset field.

    DataReport2.Sections(3).Controls.Item("Text1").DataField = rec.Fields(0).Name

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