Get a constant from a table?

L'apprentis

Redcifer
Local time
Yesterday, 23:49
Joined
Jun 22, 2005
Messages
177
I am trying to build a function using a set of 3 constants. I wanted to store all the constant values in a single table (with only 1 row).
Is it possible in the declaration of my code to set the constant value to the corresponding field of my table constant? What would be the basic syntax to set such a constant?
I am building my knowledge of VBA little by little by using documentation from this forum and the net and general but I couldn't find anything concerning that issue. I would be gratefull for any advice.
 
not so much a constant but a global variable and set its value when you open the db using code on the on open event of the first form used.

Peter
 
Thanks
How can I get a variable to be equal to a specific table field value using code?
 
something like thios should do it

Dim rs As DAO.Recordset
Dim strF1 As String
Dim strF2 As String
Dim strF3 As String
Set rs = CurrentDb.OpenRecordset("tblMyData") ' your data table name here
strF1 = rs!Field1
strF2 = rs!Field2
strF3 = rs!Field3
Set rs = Nothing

Peter
 

Users who are viewing this thread

Back
Top Bottom