Math Calaculation code

Posted on 2011-10-03
Last Modified: 2012-05-12
Hi Experts,

Im trying to perform the below calc which is in a loop,

FlxGridInvoiceInfo(rowskip_markup, "MARKUP") = Val(FlxGridInvoiceInfo(rowskip_markup, "EX_VALUE") * Val("QTY") / 100) * Val(Markup.Text)

FlxGridInvoiceInfo(rowskip_markup, "MARKUP") uses the row and column name "MARKUP", I just cant get the calc right....

FlxGridInvoiceInfo(rowskip_markup, "MARKUP") is a position on the grid
Val("QTY")  Is a column, which uses the same row as line above.
Val(Markup.Text) is a test box on the form.

Question by:deanlee17
    LVL 25

    Expert Comment

    by:Luis Pérez
    And what's the problem? Do you get any exception? Can you post any error codes or messages?

    Author Comment

    Just comes up with 0 as the value
    LVL 25

    Accepted Solution

    I think the problem is in the Val("QTY") part.

    Even if the QTY column is in the same row, you are calling to the Val function passing only the string value "QTY" as parameter, not the real cell value for that column.

    Try qualifying correctly the QTY value:

    FlxGridInvoiceInfo(rowskip_markup, "MARKUP") = Val(FlxGridInvoiceInfo(rowskip_markup, "EX_VALUE") * Val(FlxGridInvoiceInfo(rowskip_markup, "QTY")) / 100) * Val(Markup.Text)

    Hope that helps.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now