Total Report Fields using Criteria

Justin.ITPro

Registered User.
Local time
Today, 16:22
Joined
May 23, 2013
Messages
10
I am trying to run an Inventory report in Access that calculates the Storage Cost based on if there is inventory for that month. It runs two different calculations based on what is being stored... I need the report to return the storage cost for each item based on this calculation and then total at the bottom.

This is my IF Statement for Storage Cost:
Code:
    Dim StTotal As Currency
    Dim StartDate As Date
    Dim EndDate As Date
        
    If Day([ctrSDate]) >= 1 And Day([ctrSDate]) <= 15 Then
        If Reports![rptStorage]![Pkg] = "Large Drum" Then
            StTotal = Reports![rptStorage]![StCharge] + (Reports![rptStorage]![QtyProd] * DLookup("[DrumSt]", "tblPricing"))
            Reports![rptStorage]![StCharge] = StTotal
        Else
            StTotal = Reports![rptStorage]![StCharge] + (Reports![rptStorage]![QtyPD] * DLookup("[Pallet]", "tblPricing"))
            Reports![rptStorage]![StCharge] = StTotal
        End If
    Else
        If Reports![rptStorage]![Pkg] = "Large Drum" Then
            StTotal = Reports![rptStorage]![StCharge] + (Reports![rptStorage]![QtyProd] * DLookup("[DrumSt]", "tblPricing") * 0.5)
            Reports![rptStorage]![StCharge] = StTotal
        Else
            StTotal = Reports![rptStorage]![StCharge] + (Reports![rptStorage]![QtyPD] * DLookup("[Pallet]", "tblPricing") * 0.5)
            Reports![rptStorage]![StCharge] = StTotal
        End If
    End If
 

Users who are viewing this thread

Back
Top Bottom