Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Variable" Fields 1

Status
Not open for further replies.

PortyAL

Technical User
May 13, 2005
126
GB
Hi

I've done alot of work in Lotus Approach prior to moving to Access. There is one aspect of Approach which I found useful i.e. "Variable" fields. These were fields that could be set to a particular value via a macro, and related to the overall database project rather than a particular table. These fields could then be referred to in macros etc.

E.g. I have an Approach project with many tables which requires a user to log in when they open the project. There is a table with each user name and associated security level. When a user logs in, that user's security level is set as the security level for that session (a variable field). Macros then refer to that variable field which governs which functions that user has access to.

My question is obvious :) Is it possible to have "variable" fields in Access which can be set independently of any table or query and relate to the database as a whole rather than a particular table?

Thanks

AL
 
Using Access VBA, you can store a user's security level in a variable.
 
Thanks

Could you suggest some code for that?

AL
 
If you want to save the user's security level in a session-type variable, I would suggest creating a code module in Access. In your module, declare a global variable to hold the security level...

Code:
Global g_strSecurityLevel as String

Then, assuming you have a login form and a way to assess their security level at login, you can put some code behind the "Login" button on your login form to assign a value to that global variable...

Code:
g_strSecurityLevel = ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top