Click to See Complete Forum and Search --> : How to print the data in a Recordset


leo liu
April 8th, 1999, 01:57 AM
Windows 98 & VB6
I create a Recordset and insert some data into this.
Set myRS = New ADODB.Recordset
With myRS.Fields
.Append "ID", adSmallInt
.Append "Start", adDate
.Append "End", adDate
.Append "Duration", adInteger
.Append "Subject", adBSTR
.Append "Body", adBSTR
End With
myRS.Open
For Each myAppointmentItem In myItems
If Not myAppointmentItem.AllDayEvent Then
i = i + 1
myRS.AddNew
myRS.Fields("ID") = i
myRS.Fields("Start") = myAppointmentItem.Start
myRS.Fields("End") = myAppointmentItem.End
myRS.Fields("Duration") = myAppointmentItem.Duration
myRS.Fields("Subject") = myAppointmentItem.Subject
myRS.Fields("Body") = myAppointmentItem.Body
End If
Next myAppointmentItem

Then, how can I use DataReport to print the data in this Recordset?

Lothar Haensler
April 8th, 1999, 02:30 AM
add a DataReport to your project.
name it "dr"
right click on the Data report design window and "insert control/textBox"
set the DataField property to "Subject"
repeat this process for all your fields.

add the following code:
myrs.Fields("Body") = "Body"
Set dr.DataSource = myrs
dr.Show



That's it.