"Variable" fields

A

AL

I've done alot of projects in Lotus Approach and am now trying to convert to
Access. One of the features of Lotus Approach is "variable fields", which are
not connected to any particular table or record but rather hold values for
the project as a whole.

E.g. a project includes a table of user names. Each user has a security
level. When a user logs in, a macro sets the overall security for the session
(a variable field) to the security level for that user.

This is particularly useful when running macros, as you can program the
macro to check the security level before running, and therefore control what
actions each user can perform.

My question is - does Access have a similar sort of field which is not
attibutable to any table or record, but rather to the whole project?

Thanks

AL
 
D

David Lloyd

Al:

One approach is to create custom properties for the Database object in
Access using DAO. For example:

Function CreateProperty()

Dim db As Database
Dim prp As Property

Set db = CurrentDb

Set prp = db.CreateProperty("MyCustomProperty", dbInteger, 7)

db.Properties.Append prp

End Function


--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I've done alot of projects in Lotus Approach and am now trying to convert to
Access. One of the features of Lotus Approach is "variable fields", which
are
not connected to any particular table or record but rather hold values for
the project as a whole.

E.g. a project includes a table of user names. Each user has a security
level. When a user logs in, a macro sets the overall security for the
session
(a variable field) to the security level for that user.

This is particularly useful when running macros, as you can program the
macro to check the security level before running, and therefore control what
actions each user can perform.

My question is - does Access have a similar sort of field which is not
attibutable to any table or record, but rather to the whole project?

Thanks

AL
 
V

Van T. Dinh

There are a few options in Access:

1. The proper way is to implement Access Security which can do a lot more
than preventing a user running a piece of codes or Macro. However, this is
rather complex and it is easy to set it up incorrectly.

Read plenty on Access Security and try it on a *copy* of the database file.

2. You can temporarily store the UserID and his/her "Security Level" in the
TextBoxes on the "LogIn" Form. After the Log-In process, simply hide this
LogIn Form so that the values of the TextBoxes are available during the
current session. When you need the value, simply reference the TextBox.

3. You can also use VBA Public Variables but this method has some drawbacks
and it is generally not recommended.
 
Top