VBA code error "Expression is not a method"

IsalandIsaland Member Posts: 52
edited 2012-07-30 in NAV Three Tier
Hello again. When i try to save report, error "Expression is not a method" occurs, and say that mistake at 68 line (second end if in quoted code)
Where i did a mistake? :|
Dim CalcQtyOnPage As Integer
Dim PhysQtyOnPage As Integer
Dim LackQtyOnPage As Integer
Dim SurpQtyOnPage As Integer
Dim Modulo As Integer

Public Function CountQtyOnPage(ByVal Counter As Integer,Qty As Integer,Flag As String)
    if Counter < 16 then
        Modulo = Counter Mod 15
        if Modulo = 0 then
            if Flag = "Calc" then 
                CalcQtyOnPage = 0
            elseif Flag = "Phys" then 
                PhysQtyOnPage = 0
            elseif Flag = "Lack" then 
                LackQtyOnPage = 0
            elseif Flag = "Surp" then 
                SurpQtyOnPage = 0 
            end if
        end if
    else Counter > 15 then
        Counter = Counter - 15
        Modulo = Counter Mod 19	 
        if Modulo = 0 then
            if Flag = "Calc" then 
                CalcQtyOnPage = 0
            elseif Flag = "Phys" then 
                PhysQtyOnPage = 0
            elseif Flag = "Lack" then 
                LackQtyOnPage = 0
            elseif Flag = "Surp" then 
                SurpQtyOnPage = 0 
            end if
        end if
    end if
    
    if Flag = "Calc" then 
        CalcQtyOnPage = CalcQtyOnPage + Qty
        Return = CalcQtyOnPage
    elseif Flag = "Phys" then 
        PhysQtyOnPage = PhysQtyOnPage + Qty
        Return = PhysQtyOnPage
    elseif Flag = "Lack" then 
        LackQtyOnPage = LackQtyOnPage + Qty
        Return = LackQtyOnPage
    elseif Flag = "Surp" then 
        SurpQtyOnPage = SurpQtyOnPage + Qty 
        Return = SurpQtyOnPage
    end if
 End Function
MB7-840

Answers

Sign In or Register to comment.