Changing report header based on line data?

  • Thread starter Thread starter spidermanuk
  • Start date Start date
S

spidermanuk

Access2000 - Forms..

I have a text1 label in the Header section which I want to say "POSTAL
UNLESS one of the line items in the Detail_Format section say
"FEDEX"!

Whenever I put a
Me.Text1.value = "Fedex"
in the Detail_Format section (to prove a point) it gets ignored.

I short, can I change any of the text/fields in the HEADER section o
the form whilst I am in the BODY or FOOTER section?

help.

Spider.
:confused
 
spidermanuk said:
Access2000 - Forms..

I have a text1 label in the Header section which I want to say "POSTAL"
UNLESS one of the line items in the Detail_Format section says
"FEDEX"!

Whenever I put a
Me.Text1.value = "Fedex"
in the Detail_Format section (to prove a point) it gets ignored.

I short, can I change any of the text/fields in the HEADER section of
the form whilst I am in the BODY or FOOTER section?


No, not in any convenient way. The header has already been
processed by the time you get to look at anything beyond the
first detail.

However, you can use aggregate functions in the group
header. This will allow a control in the header to
calculate a total across all the details in the group. You
can then use a carefully constructed total to determine how
many details have a specific value.

I think you'll get what you want by using this kind of
expression in the text1 text box:

=IIf(Sum(shipviafield = "FedEx") = 0, "Postal", "FedEx")
 
Back
Top