How to print the data in a Recordset
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?
Re: How to print the data in a Recordset
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.