H
H
In my report I test to see if Time2< Time 1. If so, I
place an "*" next to the time. The "*" is in a separate
text box, called ESTimeFlag. This works fine.
I use VB code to check for the "*" and, if found, change
the Detail.BackColor = 255. Also, I want to count the
number of "*" so that I get a total of them on the final
page (report footer).
The count, however, gets added twice. I get double the
actual result. I moved the final count text box (which is
RedFlagCount) to the Page Footer and I see that what
happens is that on the first page of the report the count
is correct for the grand total, although none of the
detail lines of data on that fisrt page have any "*".
Looks like the routine is counting the entire report all
at once. Then, while going through the pages of the
report, the counter increases by one for each time a "*"
is encountered on a page. So, I get double the count.
What do I have wrong?
Here's what I have in the Detail (Format) build:
Dim RedFlagCounter As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer
If ESTimeFlag =*" Then
Detail.BackColor = 255
RedFlagCounter = RedFlagCounter + 1
Else
End If
RedFlagCount = RedFlagCounter
End Sub
place an "*" next to the time. The "*" is in a separate
text box, called ESTimeFlag. This works fine.
I use VB code to check for the "*" and, if found, change
the Detail.BackColor = 255. Also, I want to count the
number of "*" so that I get a total of them on the final
page (report footer).
The count, however, gets added twice. I get double the
actual result. I moved the final count text box (which is
RedFlagCount) to the Page Footer and I see that what
happens is that on the first page of the report the count
is correct for the grand total, although none of the
detail lines of data on that fisrt page have any "*".
Looks like the routine is counting the entire report all
at once. Then, while going through the pages of the
report, the counter increases by one for each time a "*"
is encountered on a page. So, I get double the count.
What do I have wrong?
Here's what I have in the Detail (Format) build:
Dim RedFlagCounter As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer
If ESTimeFlag =*" Then
Detail.BackColor = 255
RedFlagCounter = RedFlagCounter + 1
Else
End If
RedFlagCount = RedFlagCounter
End Sub