Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub report selection formula

Status
Not open for further replies.

karenmierkalns

Programmer
May 10, 2001
54
0
0
CA
I am having trouble bringing back records based on a selection formula. I have my main report, and my subreport. The divisions and programs are in the subreport. How do I use a selection formula to check against my subreport? Right now I am getting nothing returned. I am using VB to bring back the report, but even when I am in Crystal Reports, the selection formula is bringing back nothing. I realize this must have something to do with subreports, and how they are separate from the main report. How do I get around this? Is there a way to reference a subreport in the selection formula?

Thanks. - Karen
 
Scratch that - I do not want to reference my subreport. All I want to do is have them join properly.

Has there ever been problems with subreports? I believe they are joined properly, as everything else is working (with other selection formulas) - however it is quite complicated:

SQL = "SELECT * FROM (((((((((((((Affiliation " & _
"LEFT OUTER JOIN ASB ON Affiliation.AffiliationID = ASB.AffiliationID) " & _
"LEFT OUTER JOIN Classification ON ASB.ClassID = Classification.ClassID) " & _
"LEFT OUTER JOIN Contact ON ASB.ContactID = Contact.ContactID) " & _
"LEFT OUTER JOIN ASBType ON ASB.TypeID = ASBType.TypeID) " & _
"LEFT OUTER JOIN DivProg ON ASB.DivProgID = DivProg.DivProgID) " & _
"LEFT OUTER JOIN Donor ON ASB.DonorID = Donor.DonorID) " & _
"LEFT OUTER JOIN Month ON ASB.DeadlnMonthID = Month.DeadlnMonthID) " & _
"LEFT OUTER JOIN Presentation ON ASB.PresID = Presentation.PresID) " & _
"LEFT OUTER JOIN Recipients ON ASB.ASBID = Recipients.ASBID) " & _
"LEFT OUTER JOIN Selection ON ASB.SelectID = Selection.SelectID) " & _
"LEFT OUTER JOIN AwdType ON ASB.AwdTypeID = AwdType.AwdTypeID) " & _
"LEFT OUTER JOIN Program ON Recipients.ProgID = Program.ProgID) " & _
"LEFT OUTER JOIN Province ON Contact.ProvID = Province.ProvID) " & _
"LEFT OUTER JOIN Division ON DivProg.DivCode = Division.Div"

I am pretty sure this is what I want. Are there any tricks with subreports?

Thanks. - Karen
 
Nevermind..I've fixed my problem. My relationships were not defined properly. I needed left outer joins, inner joins, as well as right outer joins. Now it is working properly.

- Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top