Launching specific forms depending on permissions.

jlathem

Registered User.
Local time
Today, 15:25
Joined
Jul 25, 2010
Messages
201
Is there a way to launch specific forms at login (or after the Splash) depending on user permissions or rights?
I am using MS Access 2003.
Thanks in advance for any assistance.
James
 
what you could do is set up a table with usernames and premissions and make a colum with a flag if it has to startup when user log on.

if you then make a check in a startup procedure you could check if the user has acces and wath screens the database has to open first.

hope you understand what I am trying to explain
 
what you could do is set up a table with usernames and premissions and make a colum with a flag if it has to startup when user log on.

if you then make a check in a startup procedure you could check if the user has acces and wath screens the database has to open first.

hope you understand what I am trying to explain


Hi Jordan,

Thank you for replying.

I am still rather new to programming in Access. And that is more advance than where I am at right now. By chance do you have some sample code that I could take a look at?

Thanks again form your help.

James
 
Have a hidden field on the menu that has the ID of the user.
When the user clicks on the button to open the form:

Code:
    With CodeContextObject
        If (.FieldUser = 1) Then
            DoCmd.OpenForm "Form1", acNormal, "", "", , acNormal
        Else
        msgbox "You do not have permission."
        End If
    End With
 
or you could just test the username and react accordingly

Environ("username")

will give you the logged in name of the active user.
 
Have a hidden field on the menu that has the ID of the user.
When the user clicks on the button to open the form:

Code:
    With CodeContextObject
        If (.FieldUser = 1) Then
            DoCmd.OpenForm "Form1", acNormal, "", "", , acNormal
        Else
        msgbox "You do not have permission."
        End If
    End With

Thanks for the reply.

I apologize that I have not got back to you sooner. My computer crashed and IT has had it for a couple of days now. I just got a loner and have not had a chance to get everything that was backed up restored yet so I have not had a chance to try the code you suggested.

I will give it a shot sometime tomorrow.

Thanks again for you help.

Regards,
James
 
or you could just test the username and react accordingly

Environ("username")

will give you the logged in name of the active user.

Thanks for the reply.

I apologize that I have not got back to you sooner. My computer crashed and IT has had it for a couple of days now. I just got a loner and have not had a chance to get everything that was backed up restored yet so If I can’t get everything restored tomorrow I will have to put this project on hold for a couple days

As always Dave, Thanks for you help.

Regards,
James
 
You could change FieldUser to AccessLevel. So instead of using the user name to restrict, each user has an access level. Forms are restricted by access level.

Form1, From2 and Form3 require access level 2
Form4 and Form5 require access level 6
 

Users who are viewing this thread

Back
Top Bottom