troubleshooting Question

How to much the content of the sub reports in Ms Access using VBA

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia asked on
DatabasesMicrosoft Access
5 Comments1 Solution63 ViewsLast Modified:
Hi

I want to evaluate the sub reports in my current & prior year income statements so that the accounts lines on them can be compared properly line by line in Ms Access VBA:

Condition 1

If the current year sub report ([Reports]![srptRevenueRevenueOnlyYTD]![SumOfTotal]) has some figures but the prior year sub report is empty ([Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal]) then the prior year must return same lines with ZEROS

Condition 2

If the prio year sub report ([Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal]) has some figures but the current year sub report is empty ([Reports]![srptRevenueRevenueOnlyYTD]![SumOfTotal]) then the current year must return same lines with ZEROS

I have tried the code below its not working it keeps on asking for debug.
Private Sub Report_Load()
If IsNull([Reports]![srptRevenueRevenueOnlyYTD]![SumOfTotal]) Then
[Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal] = Null
Else
[Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal] = 0
[Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal] = [Reports]![srptRevenueRevenueOnlyYTDS2]![SumOfTotal]
End If
End Sub

Regards

Chris
ASKER CERTIFIED SOLUTION
John Tsioumpris
IT Supervisor
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros