Vat Tax

blade12568

New member
Local time
Today, 06:17
Joined
May 6, 2002
Messages
7
ok my problem is something very simple to someone out there but its got me beat at the moment

im have a problem im creating a form for an invoice (also a report for the printing side) but the problem i have is calculating the VAT (im in england) the actual calculating is easy however i have a unbound box that has the vat rate (ie 17.5%) but when i make the box a percentage number box it changes the entered value from 17.5% to either 1800% or 1750.00% what am i doing wrong ??

thanx for any help in advance!
 
Percentages should range from 0 to 1 (ex: user enters 0.17 for 17% and not 17)
 
If you want the user to enter the percentage and don't want to worry about whether they remember to put .175 in the text box, what I do is place some code behind the after update event of the text box:

me.txtboxvalue = me.txtboxvalue/100

That way, if someone enters 17.5, it will show up as 17.5, not 1750.00%.
 
Elana-

Here's a work-around of sorts which will evaluate the manner in which the VAT is input, and compensate accordingly.

Copy the code to a new module, then call it from the debug window. The first time you're prompted for the VAT, input 17.5, then note the output. Try it again, this time inputting 0.175 when prompted.

Code:
Function AddVat(NetPrice As Single) As String
'*******************************************
'Name:      AddVat (Function)
'Purpose:   Returns net amount * VAT (regardless
'           of how the VAT is displayed)
'Inputs:    [from the debug window] ? AddVAT(20.95)
'Output:    £24.62
'*******************************************

Dim sglVAT As Single, strFmt As String
Dim Msg As String, curTotal As Currency

   strFmt = Chr(163) & "###,###,##0.00"  ' Define money format
   Msg = "Enter VAT percentage"
   sglVAT = InputBox(Msg)
'next line evaluates the inputted VAT and compensates accordingly.
   sglVAT = 1 + (sglVAT / IIf(sglVAT > 0.99, 100, 1))
   curTotal = NetPrice * sglVAT
   AddVat = Format(curTotal, strFmt)

End Function

HTH,

Bob
 
vat

thanx for all the help
ive just got in from work so i prob try them later to find the best solution i have thought about putting in .175 but i want the user not to have to worry about .175 just to be able to put 17.5 or what ever the vat is in future years so i think the last 2 solutions maybe the best for me to try

ill keep u informed to how i go
thanx again to all who answered !!
 

Users who are viewing this thread

Back
Top Bottom