R
rm
When I launch a report directly from the object browser the reports
renders using Hide Duplicates as desired.
When the same report is launched from a button on a form (the code is
below), or when the same report is exported to Excel, the Hide
Duplicates function is producing different (unwanted) behaivor.
The report (actually the whole database) is used to track Machines,
software, users etc. Machine is the primary data of interest. The
query for the report is below. A Machine has multiple software
packages so location, AssociateName, Department will all repeat and
should be hidden in the same Machine record ONLY.
The desired rendering (Rendering #1 below) as produced when launched
from the object browser doesn't hide Bob's information on his second
machine in the US production department.
In the print preview and Excel renderings (Rendering #2 below) Bob's
2nd machine information is not shown. Also, Tom's machine location is
hidden because it is the same as Bob's machine location.
I would ask what I am doing wrong. However, why different results from
the same query and report design?
'Code
DoCmd.OpenReport "ComprehensiveSoftware US", acViewPreview, "", "",
acNormal
Query:
SELECT Machine, location, AssociateName, Department, software
FROM T1 JOIN T2 ON etc...
WHERE Condition1 AND Condition2 AND ConditionN
GROUP BY Machine, location, AssociateName, Department, software
ORDER BY AssociateName, Department, software
Rendering #1 from the object browser:
*********************************************
Machine A US Bob Production Software A
Software B
Software C
Machine B US Bob Production Software A
Software X
Software C
Machine C US Tom Fulfillment Software X
Software Z
Software Y
Rendering #2 print preview and spreadsheet:
**********************************************
Machine A US Bob Production Software A
Software B
Software C
Machine B Software A
Software X
Software C
Machine C Tom Fulfillment Software X
Software Z
Software Y
renders using Hide Duplicates as desired.
When the same report is launched from a button on a form (the code is
below), or when the same report is exported to Excel, the Hide
Duplicates function is producing different (unwanted) behaivor.
The report (actually the whole database) is used to track Machines,
software, users etc. Machine is the primary data of interest. The
query for the report is below. A Machine has multiple software
packages so location, AssociateName, Department will all repeat and
should be hidden in the same Machine record ONLY.
The desired rendering (Rendering #1 below) as produced when launched
from the object browser doesn't hide Bob's information on his second
machine in the US production department.
In the print preview and Excel renderings (Rendering #2 below) Bob's
2nd machine information is not shown. Also, Tom's machine location is
hidden because it is the same as Bob's machine location.
I would ask what I am doing wrong. However, why different results from
the same query and report design?
'Code
DoCmd.OpenReport "ComprehensiveSoftware US", acViewPreview, "", "",
acNormal
Query:
SELECT Machine, location, AssociateName, Department, software
FROM T1 JOIN T2 ON etc...
WHERE Condition1 AND Condition2 AND ConditionN
GROUP BY Machine, location, AssociateName, Department, software
ORDER BY AssociateName, Department, software
Rendering #1 from the object browser:
*********************************************
Machine A US Bob Production Software A
Software B
Software C
Machine B US Bob Production Software A
Software X
Software C
Machine C US Tom Fulfillment Software X
Software Z
Software Y
Rendering #2 print preview and spreadsheet:
**********************************************
Machine A US Bob Production Software A
Software B
Software C
Machine B Software A
Software X
Software C
Machine C Tom Fulfillment Software X
Software Z
Software Y