Storing Values

R

Resti M. Guay

Hi There!
i made a Log In Form, basicaly this form allows the user to log in first to
have a access to the database, my problem is, i dont realy understand what is
the use of Function, is Fuction can store values that i can set during
runtime?

thanks

Resti
 
D

Douglas J. Steele

Functions do calculations and return a value.

While you can declare certain variables in the function to be Static, so
that they'll keep their values throughout the session, functions do not
store values: when you close down the database, any Static value in the
function will be lost.

Tables are where you store values in a database.
 
R

Resti M. Guay

Douglas,

Thanks for the reply, now i need to know to set the value of the variable
and how to check its values.
Example:
I want to store the user login information in my variables and i will use
the values during the session for any restricion for certain user access
level.

Best Regards,
Resti
 
D

Douglas J Steele

While you could declare a public variable in a module (not in the code
associated with a form or report) and assign it a value in code, in this
particular case I think you'd be better off calling the function to get the
User Login information each time to ensure that you're always getting the
correct answer.

If you're using Access security, you can use the CurrentUser function to get
their Access login name. If you want their Network Id, see
http://www.mvps.org/access/api/api0008.htm at "The Access Web"
 
Top