Conditional Format for first detail only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to format my report so that the first detail in each grouping
has a "$" in front of it and the other details do not. Is there any way to
select only the first detail? If I could do that, I could probably then
concatenate the "$" in front of it.
 
Add a control to your detail section
-- Control Source: =1
-- Running Sum: Over Group

Then you can test that control's value to see if it is 1. If it is then
that is the first record in the group and then you can use code to show the
$ sign.
 
Thanks John, that worked. Although now when I concatenate the "$" the first
detail is displayed as text insted of as a number.

Can I specify the type of formatting (Currency or Standard) based on the
result of the test?
 
You might be able to switch the control's format in the detail section. I
don't know, you would need to experiment.

Other options: Two controls stacked on top of each other both bound to the
same field. One with the currency formatting one with Standard formatting,
Change the visible properties of the two controls depending on the value of
the control you are using to determine which detail row you are on.
Something like

Me.txtAmountWithDollar.Visible = txtRowCounter=1
Me.txtAmount.Visible = txtRowCounter<>1
 
Got it. I created an invisible text box call Line_Counter and set
Control Source = 1
Running Sum = Over Group

Then in my original detial box I set the Control Source to

=IIf( [Line_Counter] = 1, Format( [FY 2004] , "$#,##0 "), Format( [FY 2004
], "#,##0 "))

Thanks
 
Back
Top