How do you use expressions in this?
I'd like to highlight certain records (on a continuous form) where there are 2 (or more) records. The one with the highest value in a defined field would be the one to highlight.
Is this possible?
NB I'd like to keep the form based on a table, as I expect to use it for data entry too.
Conditional formatting using expression - 2007
-
- 5StarLounger
- Posts: 736
- Joined: 18 Mar 2010, 11:05
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Conditional formatting using expression - 2007
In the Conditional Formatting dialog, select 'Field Value Is' in the first dropdown under Condition1.
Select 'equal to' in the second dropdown.
Enter the expression Max([FieldName]) in the box next to it, with the relevant field name substituted.
Apply the desired formatting, then click OK.
Select 'equal to' in the second dropdown.
Enter the expression Max([FieldName]) in the box next to it, with the relevant field name substituted.
Apply the desired formatting, then click OK.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 736
- Joined: 18 Mar 2010, 11:05
Re: Conditional formatting using expression - 2007
Not quite what I was thinking of (though the syntax does help). I probably did not explain very well.
If there were 2 records (like below), the record with the greater version number is the one I wish to be highlighted, but other records will not be changed. The example you gave Hans, will highlight an individual field that matches the Max of all the records.
I hope that makes more sense
If there were 2 records (like below), the record with the greater version number is the one I wish to be highlighted, but other records will not be changed. The example you gave Hans, will highlight an individual field that matches the Max of all the records.
I hope that makes more sense
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Conditional formatting using expression - 2007
Select 'Expression Is' from the first dropdown, then enter an expression like this in the box next to it (the second dropdown disappears when you select 'Expression Is' from the first one):
[Version]=DMax("Version","TblCourse","CourseName='" & [CourseName] & "'")
Substitute the correct table name and field names.
[Version]=DMax("Version","TblCourse","CourseName='" & [CourseName] & "'")
Substitute the correct table name and field names.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 736
- Joined: 18 Mar 2010, 11:05
Re: Conditional formatting using expression - 2007
Lovely! That's what I wanted to do.
Mega thanks :)
Mega thanks :)
-
- 3StarLounger
- Posts: 287
- Joined: 09 Mar 2010, 23:16
- Location: Canberra Australia
Re: Conditional formatting using expression - 2007
Running a separate DMAX for each record is likely to be very slow. Whether you notice anything will depend on how many records there are, but it is something you watch out for.
Regards
John
John
-
- 5StarLounger
- Posts: 736
- Joined: 18 Mar 2010, 11:05
Re: Conditional formatting using expression - 2007
Cheers John.
I did notice a slight delay, when scrolling. But I don't envisage more than 100 records for that particular table (fingers crossed)
I did notice a slight delay, when scrolling. But I don't envisage more than 100 records for that particular table (fingers crossed)