Help to create a login form?

german

Registered User.
Local time
Today, 05:50
Joined
Jul 5, 2012
Messages
21
Hi all i am developing a small project which is about billing.
I need to restrict the rights for the users.

just help me to do it?
 
Thank u john .
i need the home page to be opened with few enabled buttons based on the rights
 
Then, to keep it as simple as possible, you would be adding YesNo fields for those rights to the user table. Adding those fields to the user management form so they can be ticked unticked for users by the administrator.

Then in the form load event of the main form check whether the current users Id has each right and set the enabled or visibility property of each button accordingly. Something like:

Code:
button1.Enabled = Nz(DLookup("CanUseButton1","tblUsers","ID = " & UserID),False)

On the demo John linked to you'll see there is already a permissions field "DBAdmin" and that is used on the dashboard in just that way:

Code:
Private Sub Form_Load()
    Me.pagAdmin.Visible = DBAdmin()
End Sub

Public Function DBAdmin() As Boolean
    DBAdmin = Nz(DLookup("DBAdmin", "tblUsers", "ID = " & UserID), False)
End Function
 
Last edited:
Thank u for the information.

But i have a tables like this tbl user and access level.
Four types of user.

i created the login form and called the home page which contains

Master,Purchase,DC like this buttons

for admin all these must be enabled and for production incharge only dc has to be enabled.

TEll me how to pass the user id to home page and make the other buttons disable


Waiting or ur reply
Thank you
 
the sample demo is not getting opened in mys sys
 
Thank u for the information.

But i have a tables like this tbl user and access level.
Four types of user.

i created the login form and called the home page which contains

Master,Purchase,DC like this buttons

for admin all these must be enabled and for production incharge only dc has to be enabled.

TEll me how to pass the user id to home page and make the other buttons disable


Waiting or ur reply
Thank you

When the logon form validates the user store the ID of the user in a global variable.

You can then lookup the role of the user at any time in the ways shown above.
 

Users who are viewing this thread

Back
Top Bottom