Cadburys wrote:
[Quoted Text] >I have a continuous form that I need to highlight certain records based on 2 >or 3 criteria. If the criteria is met then all fields within the record (or >even the back colour of that record) must be changed to red. > >I have the following fields on the form > >fldStartBy >fldDeadlineDate >fldDeadlineTime >fldCurrentTime >fldTypist >fldStatus > >Condition 1: >If is null([fldTypist]) and fldCurrentTime is 15 before fldStartTime change >the record to Red > >Conditional 2 >If fldTypist is not null and fldStatus is <> "Logged" and fldCurrentTime is >10 mins before fldStartTime change the record to Red
Use the Expression Is: option in conditional formatting. The expression could be something similar to:
IIf([fldTypist] Is Null, [fldCurrentTime] < DateAdd("n", -15, [fldStartTime]), ([fldStatus] <> "Logged" And [fldCurrentTime] > DateAdd("n" , -10, [fldStartTime]))
Because you can only use CF on text and combo boxes, you should ass a text box to the form's detail section. Set its size and position to cover the entire detail section and use Format - Send To Back to put it behind all the other controls. If you do this, you may also want to make set all the lables' and the other boxes' BackStyle Transparent.
Since the condition is a fairly long expression, it may be noticably slow. If it is, try using the expression in a calculated field in the form's record source query and just using that calculated field in the CF expression.
-- Marsh MVP [MS Access]
|