Mikkel
10-06-2008, 01:15 PM
My issue revolves around the simple requirement to have a table where I can store reusable values, like VAT, exchange rate etc and access these these constants from queries to calculate price, inclusive of VAT, for example.
For some reason this seems complicated to me, cannot get this simple issue resolved. Only way that works currently is to enter the actual value into query formula, this being a problem, if the VAT rate changes for example, then I have to edit the query, instead of just changing the value in the form based on the query/table? Please help...
Mike
boblarson
10-06-2008, 05:36 PM
You would use DLookups to get the values.
gemma-the-husky
10-07-2008, 12:27 AM
have a table called constants
have fields in there called say
programversion, type text (set to say v1.3)
vatrate, type number (double, percent, set to 17.5%)
now if you want the programversion you say
version = dlookup("programversion","constants")
normally with a dlookup you would specifiy the record after the tables name, but with a constants file, you only want to have 1 record, so you dont need ot specifiy the record
now
vatrate = dlookup("vatrate","constants")
will work as well, but its debateable whether you want to store the vat rate in a constants table. As you surmise, managing changes to the vat rate are difficult in a single value table. I would think most users have a separate vat rate table, that can include historic rates, and date applicable, as well as muilti-rates (Standard, Reduced, Zero, Exept, etc). Try it with a constants table, but be prepared to have to reconsider if and when the chancellor tweaks VAT.
Mikkel
10-07-2008, 12:48 AM
(Typing this via my mobile, so please excuse the shortness)..
Thanks! Will try & get back to you.
Question: What must the table relatonships be, and the query relationships? Currently I have no table relatIonship, when I add the table to the query, then the query does not allow new records to be created?
Mike