Hi Max,
I'm glad I could help. I also learned something new by reading the link that
StuJol provided to Allen Browne's article. While I've read many of Allen's
articles, I hadn't seen that one yet. Thanks StuJol.
I checked out the balance code of the reports in design view and it looks
like:
=Sum([DepositAmount]-[WithdrawalAmount])
But when i run the reports it does not show up.
That's because whoever designed this template wasn't thinking about the
possibility of nulls, and every record includes a null in either the
DepositAmount or the WithdrawalAmount. A null (insert mathematical operation
here: +, -, *, /, etc.) added, subtracted, multiplied, divided, etc. by a
number is still null. Luckily, Access provides us with the built-in Nz
function, which allows us to convert nulls to just about anything we want.
The general usage is:
=Nz([FieldName], ValueIfNull)
where ValueIfNull is the value that we want displayed if [FieldName] is
null. You can use numeric values, such as 0 (zero), or text strings such as
"None" or "N/A". To fix the reports, you need to incorporate the Nz function
into the control source for the Balance textboxes.
Open the Account Summary report in design view. Change the control source
for the Balance textbox to:
=Nz([DepositAmount],0)-Nz([WithdrawalAmount],0)
Change the control source for the Balance Grand Total Sum textbox to:
=Sum(Nz([DepositAmount],0)-Nz([WithdrawalAmount],0))
Make similar changes to the remaining two reports.
Happy New Year!
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
:
Hi Tom
I came accross another litle problem and hoped you could give me some help,
when i run the reports for the ledger it does not show the Balance, it only
give me totals of deposit and withdrawel amounts.
I checked out the balance code of the reports in design view and it looks
like:
=Sum([DepositAmount]-[WithdrawalAmount])
But when i run the reports it does not show up.
Thanks for your help in advance
Max
__________________________________________
:
Hi TOM
Thanks for you help, it sorted out my problem. Your advice was SPOT ON