removed to sumarize
removed to sumarize
Last edited by spkoest; 05-03-2011 at 04:17 PM.
this is extremely long, and you've post 3 times. that is really deterring.
can you shorten it to explain the issue in a few short steps? I, for one, am not reading all of this...
(only reason I care to help is because interest/money problems are interesting to me)
To summarize even more:
My question is this:
When walking through debug on the code below what circumstances could exist that when hovering over the bolded values InterestAmount and RoundedInterest they both show a value of 147.99 but the conditions is not true and interestWarning. Visible is not set to False.
Controls for the two amounts are as follows:
InterestAmount =[Forms]![frm interest pick]![interest]
RoundedInterest =Sum([percent])
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
If InterestAmount = RoundedInterest Then
InterestWarning.Visible = False
Else
InterestWarning.Visible = True
End If
End Sub
My guess is it has something to do with Sum(percent) of control source on the RoundedInterest field. The Control has a format of Currency with 2 decimal points. So would it display the textbox in this format in debug but compare to a different decimal level?
Or it has something to do with it being in the On Format event of the report footer. I moved the code to the On Print Event of the report footer and the same results occured.
Reports: Show totals at bottom of reportAuthor(s)Dev Ashish(Q) I want to show a total at the bottom of each page, but I keep seeing #error instead, whats wrong?
(A) Your problem is that access does not allow the Sum() function in the page footer. So to get around the problem, create a control in another section of your report that performs the calculation, and set its visible property to false. Then create another unbound text box in the page footer. Enter the name of the control containing the calculation as the text boxes controlSource property setting.
I wonder if the SUM() is not allowed in the report footer? Hmmmm. but debug shows it????????
Well... I created to variables, assigned the control.values to those variables, then compared the variables in my If statement and it works.
Still not sure what is going on but it is a work around.
Thanks for letting me ramble.
Dim varInterestAmount As Currency
Dim varRoundedInterest As Currency
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
varInterestAmount = InterestAmount
varRoundedInterest = RoundedInterest
If varInterestAmount = varRoundedInterest Then
InterestWarning.Visible = False
Else
InterestWarning.Visible = True
End If
End Sub