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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

10 SUB Reports linked to the Main 1

Status
Not open for further replies.

teqtaq

Technical User
Nov 18, 2007
197
US
I have a Report that containing 10 SUB Reports. No there were no toher way doing it. They all have different headers and sorting.

Report run off the Form that has 2 combo boxes where you select 2 Values or none in both. In case when no value was selelcted Report should bring data for all Regions and All Managers.

Main Report's Page Header has Region and Manager.

I had places all Reports into Region Group and linked by Region and Manager.

I have code I am using to filter Report (on Click of the cmb when Report is starting to run):

If Not IsNull(Forms!RetReports!cmbMngr) Then
strWhere = "Manager=" & Chr(34) & Forms!RetReports!cmbMngr.Column(0) & Chr(34) & _
" And [Region]=" & Chr(34) & Forms!RetReports!cmbRegion.Column(0) & Chr(34)

End If
_________________________________________________________

I have also inserted same code on Open event for each SUB.
Is this seems correct approach to you?
Or should my SUBs react to the Linked fields?
And does this code means IF values are not selected - give me all Regions and Managers?

Thanks so much
 
what i would do is have this as the rowsource of the comboboxes

Code:
Select '--All Region -- '
union 
Select Region 
from RegionTable

Code:
Select '--All Manager''s-- '
union 
Select Manager
from ManagerTable

and have this as the RecordSource of the report


Code:
Select Manager,Region ,otherfields that you want 
from tablename
where Region = iif(Forms!RetReports!cmbRegion='--All Region --',Region,Forms!RetReports!cmbRegion)
and Manager= iif(Forms!RetReports!cmbManager='--All Manager''s-- ',Manager,Forms!RetReports!cmbManager)
 
RecordSource of the Report?
Where is it?

Thanks pwise!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top