Help, using a table to store constants

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I would like to make a table to store all constants. I therefore need to read each record of this table and assign the values to the
global variables?

How do I read each record of a table in code?

I did check the Internet before I came here. Your help would be appreciated.

ad
 
It's easy enough to read a value from a table using DLookup.
If that is unfamiliar, see:
http://members.iinet.net.au/~allenbrowne/casu-07.html

However, reading the name of a constant and then attempting to convert it to
a numeric(?) value is a different matter. You would need to use two columns:
one containing the name of the constant, and another containing the value.
You could then DLookup() the value of the constant by finding its name. By
the time you have done that, you have gone around in a circle, i.e. the
result:
MyVariable = DLookup("ValueField", "ConstantTable", _
"ConstantName = 'dbText'")
ends up the same as:
MyVariable = dbText
 
1) Why?

2) v1 = dlookup("fieldname","tablename","intField = " & 1)
or
3) vArray = rst.GetRows(nMaxGetRows)

(david)

ad said:
I would like to make a table to store all constants. I therefore need to
read each record of this table and assign the values to the
 
Back
Top