Calculating the Tax Amount



In most applications that involve order entry, you may need to calculation the net price of an item based on the tax rate applied to the item. Unlike Microsoft Excel, Microsoft Access doesn't provide its own function to calculate the amount of tax of an item. Fortunately, many sample databases that ship with Microsoft Access calculate this and you can simply use their pseudo-code.

Practical Learning: Calculating the Tax Amount of an Item

  1. Start a new database named Tax Amount
  2. Start a new blank form and design is as follows:


    Form Properties
    Save As: TaxCalculation
    Caption: Tax Amount Calculation
    Record Selector: No
    Navigation Buttons: No
    Modal: Yes
    Border Style: Dialog


    Label Caption Text Box Name Control Source Format Dec Places Default
    Marked Price txtMarkedPrice   Currency 2  
    Tax Rate txtTaxRate   Percent   0.0575
    Tax Amount txtTaxAmount =CLng(Nz([txtMarkedPrice])*Nz([txtTaxRate])*100)/100 Currency 2  
    Net Price txtNetPrice =Nz([txtMarkedPrice])+Nz([txtTaxAmount]) Currency 2  
  3. Save the form and switch it to Form View
  4. Test it with some values


Home Copyright 2004 FunctionX, Inc.