Can different users have different startup options?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Access 2002, is it possible to have different menus (forms) for different
users at startup?
 
Sure. Just build your AUTOEXEC macro to open a form based on the user.
You will have to add a separate line for each user and include the name of
the form that should open.

Rick B
 
Or you can create a table (tblUserForms) with a field UserID and a field
FrmName, and then use the autoexec macro just to run a VBA function
which opens a form by looking up the user in the table... something like:

Function Startup_Form()
usr = Application.CurrentUser
frm = DLookup("[FrmName]", "tblUserForms", "[UserID]='" & usr & "'")
DoCmd.OpenForm frm
End Function

This assumes that you have implemented Access security, so
Application.CurrentUser will return the user name. If not, you can use:

usr = Environ("UserName")

instead, which returns the Windows login name. The advantage of this
method is that it is easier to maintain a table than change a macro
design every now and then, and it's a piece of cake to add new users as
long as they don't require a new form (that assumes you are selecting
from a finite pool).

HTH,
Nikos
 
Back
Top