Unanswered: loop through field on table to create regional reports?
Does anyone know how to loop through the a field when creating reports to give individual region reports.
the code I'm currently using is:
If reporttype = "RptClassSummaryRegionArea" Then
strselect = "tblreview.IntReviewCaseID, tblClassification.StrClassification, tblRegion.StrRegion, tblArea.StrArea, tblreview.DateInput, tblcase.DistributionChannel"
strfrom = " (tblRegion INNER JOIN (tblArea INNER JOIN tblsortcode_branch ON tblArea.IntArea = tblsortcode_branch.IntArea) ON tblRegion.IntRegion = tblsortcode_branch.IntRegion) INNER JOIN (tblClassification INNER JOIN (tblcase INNER JOIN tblreview ON tblcase.IntCase = tblreview.IntReviewCaseID) ON tblClassification.IntClassification = tblreview.IntClassification) ON tblsortcode_branch.BranchID = tblcase.BranchID"
strsql = "select " & strselect & " from " & strfrom & " where " & strwhere & ";"
qd.SQL = strsql
stDocName = reporttype
DoCmd.OpenReport stDocName, acViewDesign
Reports!RptClassSummaryRegion.lblinput.Caption = strinput
Reports!RptClassSummaryRegion.lblRegion.Caption = StrRegion
Reports!RptClassSummaryRegion.LblDistChannel.Capti on = strdistribution
DoCmd.OpenReport stDocName, acViewPreview
This is ran from a form and there is a large section of code that creates the strwhere section of code.
What I want is to be able to loop it for each region.
intregion = region number
strregion = region name
there are currently nine regions at the moment.