-
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
-
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
-
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