TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: Jennifer
date: 2004-07-15 22:07:00
subject: CR subreport queries in V

Hello,

I am attempting to relay an SQL query to a report designed with
Crystal Reports from the Visual Basic environment.  The report I
designed in CR has subreports embedded within the main report.  I have
been able to write a query which changes the main report (see below),
but I am unable to find a way to write a similar query to update
information in the subreports.  What is the correct way to do this?

Private Sub Form_Load()

Screen.MousePointer = vbHourglass
Set Report = Application.OpenReport("C:\Sample Report.rpt")
Report.DiscardSavedData

Dim strSQLFilter As String

strSQLFilter = "Scenario 1"

Report.SQLQueryString = _
   "`Table1`.`Field1`, `Table1`.`Field2`, FROM `Table1` WHERE
`Table1`.`Field1`='" & strSQLFilter & "'"

' -- HOW DO I SET THE QUERIES FOR ALL OF THE SUBREPORTS? -- '

CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com

---
 * RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
 * RgateImp.MoonDog.BBS at 7/15/04 10:07:54 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.