To answer you questions.
1. The details of the report are the marks givven by men and weman to the
feelings towards countries (project for school).
2. the report show the avrage grades givvedn by all men and all weman to
each country.
3. I would like to highlight the text box with the hights and lowenst mark
for each group. total 4 controls.
However, accress finds the lowest and highest of both genders (total of 2
controls) instead of each gender group.
You can easily use code in the report's Detail Format event:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If ([ANumber] = DMax("[ANumber]", "TableName", "[Gender] = 'Male'")) _
Or ([ANumber] = DMax("[ANumber]", "TableName", "[Gender] = 'Female'"))
_
Or ([ANumber] = DMin("[ANumber]", "TableName", "[Gender] = 'Male'")) _
Or ([ANumber] = DMin("[ANumber]", "TableName", "[Gender] = 'Female'"))
Then
Me.ANumber.BackColor = vbYellow
Else
Me.ANumber.BackColor = vbWhite
End If
End Sub
Change "TableName" to whatever the name of the report's record source
is... a table or a query name".
Change [ANumber] to the name of the field that contains the mark
value.
Change [Gender] to the name of the field that contains whether the
student is Male or Female.
Note: as written above, Gender is a Text datatype field, and it's
value is either "Male" or "Female".
If, in fact it is a Yes/No datatype, where the values are either -1 or
0, then use the following syntax:
([ANumber] = DMax("[ANumber]", "tblBlank", "[Gender] = -1"))
or
([ANumber] = DMax("[ANumber]", "tblBlank", "[Gender] = 0))
etc...