Conditional format in a report

M

Martin Hopkins

Hello,

Can anyone help please.

I have a report detailing the number of staff I need to do a particular
task.

The report detail deplays the task details based on a query. The available
personnel are detailed in a sub-report on the report. This is linked to the
main report by the type of trade required for the task.

What I want to do is have the "Can I complete the Task" filed, turn Green if
I want say 2 tradesmen and the subreport details more than 2 are available.

And turn Red if less the 2 tradesmen are available.

I have tried conditional format on the field but I cannot get the syntax
correct to say:

Condition 1 - "If value in sub report is greater than main report value"
then set filed background green.

Condition 2 - "If value in sub report is less than main report value" then
set filed background red.

If the fields where in the main report detail then I have no problem. But in
a sub-report??

Thanks if any help is given on this matter.

Martin Hopkins
 
M

Marshall Barton

Martin said:
I have a report detailing the number of staff I need to do a particular
task.

The report detail deplays the task details based on a query. The available
personnel are detailed in a sub-report on the report. This is linked to the
main report by the type of trade required for the task.

What I want to do is have the "Can I complete the Task" filed, turn Green if
I want say 2 tradesmen and the subreport details more than 2 are available.

And turn Red if less the 2 tradesmen are available.

I have tried conditional format on the field but I cannot get the syntax
correct to say:

Condition 1 - "If value in sub report is greater than main report value"
then set filed background green.

Condition 2 - "If value in sub report is less than main report value" then
set filed background red.

If the fields where in the main report detail then I have no problem. But in
a sub-report??


You're on the right track. You do need to get the subreport
count up to the main report.

Add a hidden text box to the same section of the main report
that contains the subreport and set its control source to an
expression like this:
=IIf(subreport.Report.HasData,subreport.Report.subtextbox,0)

Then use this main report text box in your 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