Sorting records.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Our security writes parking violations. I need to sort the data using the
vehicle's tag number and keep those records with multiple violations
together. I would also like to highlight those records on the printed
report. Sorting the records wasn't a problem, the problem is how to tell
Access to highlight those records. Any suggestions?
 
Tom,

To clarify, do you only want records with multiple violations highlighted or
all records that have violations? Also, I assume that violations are stored
in a seperate table from vehicle definitions.

Barry
 
Our security writes parking violations. I need to sort the data using the
vehicle's tag number and keep those records with multiple violations
together. I would also like to highlight those records on the printed
report. Sorting the records wasn't a problem, the problem is how to tell
Access to highlight those records. Any suggestions?

Group and sort the report (using the report's Sorting and Grouping
dialog) on the Tag Number field.
Set the Group Header to Yes.

Place the Tag control in the Group header.
Add an unbound control to the group header.
Set it's Control Source to
=Count(*)
You can make this control Not Visible.
Name it txtGroupCount.

Note: If you don't want Group Header to actually display, set it's
Visible property to No.

Add another Tag control in the Detail section.
Using the Tag control's (the one in the Detail section) Conditional
Formatting property, set Condition1 to:
Expression Is.
Write:
[txtGroupCount] >1
in the dialog box.
Set the back color to whatever color you want.
Save the changes.

The Tags with a count of more than one will be colored.
 
Back
Top