Thanks for your advice....Hopefully, I can explain this so it makes sense.
I've sought help in the past from newsgroups and haven't been able to find a
solution that will work....So I greatly appreciate your help!!
I have a report that is called ServiceReport it has a subreport called
ServiceSubreport. The ServiceReport contains the Customer Name, Address and
the tests to be run on the specified system. The ServiceSubreport lists the
system. These are linked by Type_of_System. I have a query that sorts the
information according to my needs. For example, Bart S1, is for Bart's
service for Summer week 1. The query has all the correct information. I
then have a form that has 20 buttons. There is a button for each employee
(Bart/Brad) and a button for each week of the summer and each week of the
winter. I've attached the code behind Bart S1 below so you can see what it
says. The button opens Service Report and then applies the Bart S1 (or
corresponding Query) to the ServiceReport as a filter. I've, also, attached
a copy of this code below. To some degree this works because it does pull
all the systems according to the defined week but it does not distinguish
between the Service (A,S,or W). However, if you open the query, only the
systems with the defined week and service are displayed. When I've tried
sorting according
to the Service, I then end up with Reports that have all systems A on one
page, and S on another, and then W on another. I need all systems for the
specified week of A and S to appear on the same report, and to not display
any systems from the remaining Service. It is complicated because I need
each Type_of_System to be seperated out so that each customer has a seperate
report for each Type_of_System that we service from their account. I can get
my report to do this by using the sort command on the report.
As of right now, I can get the right sorting and grouping on the report,
except, that the service will not distinguish according to what I think I've
designed.
Here's a copy of all the code:
This is the code behind the button for Summer week 1 for Bart on the
ServiceReports Form:
'------------------------------------------------------------
' Bart_Week_S1_Click
'
'------------------------------------------------------------
Private Sub Bart_Week_S1_Click()
On Error GoTo Bart_Week_S1_Click_Err
DoCmd.OpenReport "ServiceReport", acViewPreview, "Bart S1", "", acNormal
DoCmd.OutputTo acReport, "ServiceReport", "RichTextFormat(*.rtf)",
"Service Report.rtf", False, "", 0
Bart_Week_S1_Click_Exit:
Exit Sub
Bart_Week_S1_Click_Err:
MsgBox Error$
Resume Bart_Week_S1_Click_Exit
End Sub '------------------------------------------------------------
There is a button on the form for 2 employees for both Summer and Winter
weeks of service.
Bart S1 is a query with the following code:
SELECT *
FROM [System Information]
WHERE ((([System Information].Employee)="Bart") AND (([System
Information].Service)="A") AND (([System Information].Week)=0)) OR ((([System
Information].Employee)="Bart") AND (([System Information].Service)="A") AND
(([System Information].Week)=1)) OR ((([System Information].Employee)="Bart")
AND (([System Information].Service)="A") AND (([System Information].Week)=7))
OR ((([System Information].Employee)="Bart") AND (([System
Information].Service)="S") AND (([System Information].Week)=0)) OR ((([System
Information].Employee)="Bart") AND (([System Information].Service)="S") AND
(([System Information].Week)=1)) OR ((([System Information].Employee)="Bart")
AND (([System Information].Service)="S") AND (([System Information].Week)=7));
There is a query for each week of the Summer and each week of the winter.
Hopefully, I've explained my problem.....If you need more information,
please let me know. Thank you again for all of your help!!!