Conditional Formating or Continuous Form Record Formatting

C

Cadburys

Hi

I have another question.

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

I cannot do this with conditional formating ? or can I?

Is it possible to change the formatting of individual records on a
continuous form using code - if so then how?

Thank you!
 
M

Marshall Barton

Cadburys said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top