|
-
Aug 7th, 2006, 06:45 AM
#1
Thread Starter
Fanatic Member
multiple reports CR9 viewer
Hi
I have a CR9 viewer inside my VB6 form ,the back end is Access 2003.
I am using the following SQL to view a report corresponding to BID=24(it's the primary key)
VB Code:
SQL="SELECT Btest.*, BOrigin.*, BDestination.*, Btest.BID"
SQL= SQL & " FROM (Btest INNER JOIN BOrigin ON Btest.BOriginID = BOrigin.BOriginID) INNER JOIN BDestination"
SQL=SQL & " ON Btest.BDestinationID = BDestination.BDestinationID WHERE (((Btest.BID)=24))"
rs6.Open SQL, cn, adOpenKeyset, adLockPessimistic
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Report3.rpt", 1)
oReport.Database.SetDataSource rs6, 3, 1
frmreport.crvMyCRViewer.ReportSource = oReport
frmreport.crvMyCRViewer.ViewReport
frmreport.crvMyCRViewer.Refresh
frmreport.Show 1
rs6.Close
But the report instead of giving me the report corresponding to 24(the ID of the record),returns to me 63 reports.
I tried the SQl query in my Database access(I run the query corresponding to SQL) and it returned to me a single record(the correct answer)
What's wrong?
Please help me it's very urgent
thanks
Last edited by engnouna; Aug 7th, 2006 at 01:24 PM.
-
Aug 10th, 2006, 03:18 AM
#2
Addicted Member
Re: multiple reports CR9 viewer
ok u put the following code in it also
CRV.SelectionFormula = "{BTEST.BID}=24"
i hope this will solve ur problem
Thanks and Regards,
Muhammad Abbas
-
Aug 10th, 2006, 03:23 AM
#3
Thread Starter
Fanatic Member
Re: multiple reports CR9 viewer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|