A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help, using a table to store constants



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2004, 06:24 AM
ad
external usenet poster
 
Posts: n/a
Default 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  
Old September 13th, 2004, 07:35 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

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  
Old September 13th, 2004, 07:38 AM
david epsom dot com dot au
external usenet poster
 
Posts: n/a
Default

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  
Old September 13th, 2004, 07:59 AM
ad
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.