Ap******@gmail.com wrote:
Hello
I have a table used to maintain information on Service Events.
Each record contains a Repair, Maint, and Battery checkbox
(bound/boolean).
Any one of these fields may be checked of left empty.
I want to generate one report that lists all the Repairs, then lists
all the Maint, and then
lists all the Battery events. I am not sure how to approach this.
Should I create seperate
subforms and insert them in the main report, or can it all be done in
the main report
somehow ?
ThankYou
Greg
You could create a separate column. Ex:
Expr1:IIF(Repair,1,IIF(Maint,2,IIF(Battery,3,4)))
You could then sort on Expr1 and filter out those that are 4. This
would assume there can be only 1 type tho and if there are multiple
types for each record that would not work.
If you have multiples (battery and Repair for example on 1 record) then
you might be best to create a UNION query for the report recordsource. Ex:
Select * From Table1, "1" As Fix From Table1 _
Where Repair
UNION ALL
Select * From Table1, "2" As Fix From Table1 _
Where Maint
UNION ALL
Select * From Table1, "3" As Fix From Table1 _
Where Battery
Then in the report, using Sorting and Grouping sort on Fix as the
primary sort.