Thanks for reading this and helping me out. I really appreciate it. I've only
been working with Access about 1 1/2yrs. So, I'm great full for any help
Sorry about the terminology. I do have a tendency to get them mixed up.
I don't know how detailed you want me to be, so here it is.
I have one report. It is a form letter where I can have one "form" and add
different things to it. Like a mass mailing letter. I'm trying to use the
same report/subreport for 3 things.
I use one query called: qryTaps. That query consist of:
StaffId
Lname
Fname
WorkPlan
WorkRec
IntDue
IntRec
FinalDue
FinalRec
Archive
About 4 other fields that I don't need.
Supervisor
Location
AssistMan
UnitMan
And that's it for the query.
I use a form for generating the report. The fields are List55 which consists
of WorkPlan - FinalRec. A Month group called grpMonth. A department group
that groups those in a certain department for selection.
And a combo box with the names of the department people.
Say for example I choose "WorkPlan" = January where the archive field is
false and the supervisor name is "Tom"
Here's the code that does that. I believe this produces a filter because when
I look at the report, the filter field will show the results of the
information. Don't know if this is the proper way to do it.
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False" & _
" AND qrytaps.Supervisor=""" & Me.cboloc & """"
The name of the main report is called: rptTaps. The record source is: qryTaps.
No filter showing. Filter on load = yes. In the detail section I have the
supervisor name and his department.
I have a subreport in the Detail section called "rptTapsSub". The record
source is also called: qryTaps. On the Data Tab, The SourceObject is: Report.
rptTapsSub. Link Master/Child is: Supervisor;Workplan. Filter on empty.
Master = Yes. Enabled = Yes
Here's what's supposed to happen. When I click on the Print Command, the
strWhere statement is generated. I believe it is supposed to produce all the
records from the qryTaps that match the strWhere criteria and show them in
the rptTapsSub subreport.
This is where the problem happens. If I have 3 records, it will show the
three records. It will also generate 3 reports with the exact same
information and that's what I'm trying to avoid. Now if there's enough
information to display/print then there is room on the report then fine,
another page is ok.
The final goal is to either Print or Email these reports.
There are two other subreports also. So on load it does a select case that
will hide the other subreports if I don't need them.
I do have a Supervisor table called tblSupervisor. There is no relation set
up in the tblSupervisor.
I hope this was enough information and as detailed as I think I can be.
Again, Thanks for the help..
Duane said:
Please don't use the term "form" when talking about reports and subreports. I
assume you don't mean form. Also, I think you mean the main and sub reports
have the same Record Source not control source.
If you don't want your information to repeat, move the subreport to a header
or get rid of the detailed records in the main report with a totals query as
the Record Source.
If you can't figure this out, come back with more information about your
tables and data and how you want them to appear in your report.
I guess you're correct. The information for both the main form letter and the
three sub forms are coming from the same control source. A query. When i
[quoted text clipped - 14 lines]
I hope this kind of explains it.