Table of database defaults

battenberg

Burning candles both ends
Local time
Today, 22:42
Joined
Sep 25, 2006
Messages
118
Hi

I want to have a table of 'database defaults' in my DB
each of the defaults is a setting that applies to all of the DB

how do i relate this table to the rest of the relationships or more simply how can i pull in one of these default settings into a calculation?

Example: I am trying to generate a warranty expiry date on a 'field exit' event.

the default warranty period in 'months' is contained within 'tblDatabaseDefaults' under the 'WarrantyPeriod' field

Code:
Dim intWarrantyIncrement as integer

intWarrantyIncrement = ??? (tblDatabaseDefaults - WarrantyPeriod)

I think I may just be being thick!!!

can anyone help ??
 
Sounds to me like you would set it up as a module. It would accept an input value, and return a result. Is this what you are looking for. Only just learnt modules, 2 months and still in training. ;)
 
Use the DLookup function. I would need to know more about the layout of your tblDatabaseDefaults to give more specifics but basically:

Code:
Dim intWarrantyIncrement as integer

intWarrantyIncrement = DLookup("WarrantyPeriod","tblDatabaseDefaults", "CRITERIA GOES HERE")

Look in the help under "DLookup Function", it will explain it better than I can. It returns values from tables.
 
Ahhh Haa...you beauty!!!

Thank you so much...

Dlookup is now the new president of planet Battenberg!
 
Hey Battenberg,

Check out ELookup by Allen Browne. I figured out DLookup, found it aweful slow, then found Allen's Extended DLookup- MUCH better!
 

Users who are viewing this thread

Back
Top Bottom