From: CJ on
Hi Groupies

How can I use conditional formatting to format a duplicate date in a report?
I need the duplicates to show up but I would like them to be obvious.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!

From: Allen Browne on
"CJ" <private(a)newsgroups.com> wrote in message
news:#eDXSWU#KHA.3880(a)TK2MSFTNGP04.phx.gbl...
> How can I use conditional formatting to format a duplicate date in a
> report? I need the duplicates to show up but I would like them to be
> obvious.


Do you mean duplicates between records? i.e. if this record has the same
date as the one before it, than highlight the fact?

Conditional Formatting can't compare across records, so let's explore
alternatives, assuming the report is sorted by date (so duplicates are
contiguous.)

You could use code in the section's events (Print to record the previous
date, and Format to flag the duplicate if it's the same.) This has several
disadvantages: it's slow, unreliable across page breaks (where you don't
print all report pages), and doesn't work at in in Report or Layout view.

A better approach would be to use a combination of the HideDuplicates and
IsVisible properties. HideDuplicates will hide the date if it's the same as
the one before. You can then add another text box bound to an expression
that tests the IsVisible property of the date box. If IsVisible is false,
then show the date in whatever color/bolding you want to flag it as a
duplicate.

If that approach is not familiar, here's some more info on working with
them:
http://allenbrowne.com/casu-21.html
Although the article is for a different purpose, it illustrates the idea.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




From: CJ on
That is sort of what I thought.

Thanks for the confirmation Allen.
--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
"Allen Browne" <AllenBrowne(a)SeeSig.Invalid> wrote in message
news:u6bKivV%23KHA.4308(a)TK2MSFTNGP04.phx.gbl...
> "CJ" <private(a)newsgroups.com> wrote in message
> news:#eDXSWU#KHA.3880(a)TK2MSFTNGP04.phx.gbl...
>> How can I use conditional formatting to format a duplicate date in a
>> report? I need the duplicates to show up but I would like them to be
>> obvious.
>
>
> Do you mean duplicates between records? i.e. if this record has the same
> date as the one before it, than highlight the fact?
>
> Conditional Formatting can't compare across records, so let's explore
> alternatives, assuming the report is sorted by date (so duplicates are
> contiguous.)
>
> You could use code in the section's events (Print to record the previous
> date, and Format to flag the duplicate if it's the same.) This has several
> disadvantages: it's slow, unreliable across page breaks (where you don't
> print all report pages), and doesn't work at in in Report or Layout view.
>
> A better approach would be to use a combination of the HideDuplicates and
> IsVisible properties. HideDuplicates will hide the date if it's the same
> as the one before. You can then add another text box bound to an
> expression that tests the IsVisible property of the date box. If IsVisible
> is false, then show the date in whatever color/bolding you want to flag it
> as a duplicate.
>
> If that approach is not familiar, here's some more info on working with
> them:
> http://allenbrowne.com/casu-21.html
> Although the article is for a different purpose, it illustrates the idea.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
>
>