<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY style="MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px">
<DIV><FONT size=2></FONT>This is some code I am using in an Active Reports
designer that works for me. It is based on the code in Chapter 6 of the
manual "Unbound Reporting and Grouping"</DIV>
<DIV> </DIV>
<DIV>Private Sub ActiveReport_DataInitialize()<BR> Set mRS =
New ADODB.Recordset<BR> '---This report gets its recordset
from a custom Activex control's property</DIV>
<DIV> Set mRS =
frmMain.ActiveControl.GetSummaryRS<BR>
mRS.MoveFirst<BR> With
Fields<BR> .Add
"Category"<BR> .Add
"Boundaries"<BR> .Add
"Obs"<BR> .Add
"Percent"<BR> End With</DIV>
<DIV>End Sub</DIV>
<DIV> </DIV>
<DIV><BR>Private Sub ActiveReport_FetchData(EOF As
Boolean)<BR> <BR> 'If mRS.EOF = True Then
Exit Sub<BR> If Not mRS.EOF
Then<BR> '---Sets ActiveReports fields
collection values to mRS values<BR>
Fields("Category").Value =
mRS!Category<BR>
Fields("Boundaries").Value =
mRS!Boundaries<BR> Fields("Obs").Value
= mRS!Obs<BR> Fields("Percent").Value
= mRS!Percent<BR> End If<BR>
<BR> If Not mRS.EOF
Then<BR> '---If not at the EOF then
set FetchData's EOF value to false<BR>
EOF = False<BR> '---Advance the
RS<BR>
mRS.MoveNext<BR> End If</DIV>
<DIV> </DIV>
<DIV>End Sub</DIV>
<DIV> </DIV>
<DIV>Gary Ray - Application Developer<BR>Workforce Information Systems R &
D<BR>E-Mail <A href="mailto:gray@utah.gov">gray@utah.gov</A><BR><BR>>>>
paul.hartland@fsmail.net 03/14/03 02:42AM >>><BR>To all,<BR><BR>Has
anyone had any experience with Active Reports v2.0 for Visual Basic, if so I
wondered if someone could help me with somthing (bearing in mind I only started
using it yesterday). I have built a report using the ADO connector and I
need it to buils the recordset on the fly. So I am trying to use the following
method.....<BR><BR>repPersonnelByOffice.dcRptData.Recordset = "SELECT * FROM
[tblPersonnel] WHERE [FinishDate] Is Null ORDER BY [Office],
[Surname]"<BR><BR>But I get the error Type Mismatch and the whole line gets
highlighted when I click debug. Now I can't see anything wrong with this,
can anyone point out my mistakes please.......<BR><BR>Thanks in
advance.<BR><BR>Paul
Hartland<BR><BR>__________________________________________________________________________<BR>Freeserve
AnyTime - Go online whenever you want for just £6.99 a month for<BR>your first 3
months, that's HALF PRICE! And then it's just £14.99 a month<BR>after
that.<BR><BR>For more information visit <A
href="http://www.freeserve.com/time/">http://www.freeserve.com/time/</A> or call
free on <BR>0800 970
8890<BR><BR><BR>_______________________________________________<BR>dba-VB
mailing list<BR>dba-VB@databaseadvisors.com<BR><A
href="http://databaseadvisors.com/mailman/listinfo/dba-vb">http://databaseadvisors.com/mailman/listinfo/dba-vb</A><BR><A
href="http://www.databaseadvisors.com/">http://www.databaseadvisors.com</A><BR><BR></DIV></BODY></HTML>