Connecting Tech Pros Worldwide Help | Site Map

Dlookup changing vat

  #1  
Old July 2nd, 2009, 05:34 PM
Member
 
Join Date: Sep 2007
Location: Israel
Posts: 38
I have an invoice form (access 2003) where vat is a part of payment. The problem is : when VAT changes, I want the new VAT to be placed in my form.
I have a VAT table where I have [from date] - [to date] and the relevant VAT.
I'm trying to use :

DlookUp("[MyField]","MyTable","#07/02/2009# Between [from_date] And [to_date]")

But VAT taken is the old VAT (the change was on july 1st).

What can I do please?
Thanks.
  #2  
Old July 3rd, 2009, 12:19 PM
Expert
 
Join Date: Jun 2007
Location: Derbyshire, UK
Posts: 344
Provided Answers: 5

re: Dlookup changing vat


Quote:
Originally Posted by eyalco View Post
I have an invoice form (access 2003) where vat is a part of payment. The problem is : when VAT changes, I want the new VAT to be placed in my form.
I have a VAT table where I have [from date] - [to date] and the relevant VAT.
I'm trying to use :

DlookUp("[MyField]","MyTable","#07/02/2009# Between [from_date] And [to_date]")

But VAT taken is the old VAT (the change was on july 1st).

What can I do please?
Thanks.
Hi

Have you tried

DlookUp("[MyField]","MyTable","[from_date] <= #07/02/2009# And [to_date] >=#07/02/2009#")

??

MTB
  #3  
Old July 3rd, 2009, 12:59 PM
mshmyob's Avatar
Expert
 
Join Date: Jan 2008
Location: witness protection
Posts: 608
Provided Answers: 2

re: Dlookup changing vat


To make life simpler you could make a slight redesign.

You keep your VAT table but only need one record with just the VAT rate in it without the dates. When VAT changes just overwrite the existing VAT rate.

Then in your invoice table (not the InvoiceDetail table) you save the VAT rate that was used for that invoice.

No need to be creating new records with date ranges for VAT rates and doing complicated lookups. Each invoice will save the VAT rate used for that particular invoice.

cheers,
Reply