If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Help, using a table to store constants
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 |
#2
|
|||
|
|||
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 -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "ad" wrote in message ... 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 |
#3
|
|||
|
|||
1) Why?
2) v1 = dlookup("fieldname","tablename","intField = " & 1) or 3) vArray = rst.GetRows(nMaxGetRows) (david) "ad" wrote in message ... 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 |
#4
|
|||
|
|||
I thought it would be easy for you guys ^_^
Thank you guys very much. ad "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... 1) Why? 2) v1 = dlookup("fieldname","tablename","intField = " & 1) or 3) vArray = rst.GetRows(nMaxGetRows) (david) "ad" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Footnotes in tables | Pam | Page Layout | 6 | June 18th, 2004 01:56 PM |
STORE multiple values from a lookup table | beller | Database Design | 2 | June 16th, 2004 04:16 AM |
resize table from A4 size to A5 | ims | New Users | 3 | June 9th, 2004 01:05 AM |
COMPARE THE TWO TABLES | Stefanie | General Discussion | 0 | June 4th, 2004 04:36 PM |
Cannot join 1:M table into M:M tables | Tom | Database Design | 4 | May 19th, 2004 10:16 PM |