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!

Re_posted

Status
Not open for further replies.

wdu94

Programmer
Aug 15, 2001
61
US
Hi, All,

I handle user Login problem by myself.

(1). I have the table that there are 5 fields: UserID, FirstName, LastName, Department, PassWord.

(2). I have three kind of forms that there are: Member Login form, New Member Login form and Forgot PassWord form.

(3). This is a access project that include 4 part Interfaces:
eg. Interface1
Interface2
Interface3
Interface4
And, each Interface have the login access.

(4). Right now, everybody can login all 4 Interfaces, but I want to restrict them that's means if user registrator for "Department" is Office Staff(Department name), this user can just log on Interface1, Interface2 and Interface3 and block to log on Interface4. The Login system is depend on "Department".

I don't have idea for that. Anybody can help me out.

Many Thanks
Jeannia
 
Hi Jeannia!

One good method would be to make a form which you open and hide using the autoexec macro. This form should have a textbox where you will store the department name when the user logs in. Then in the forms for each interface use this code in the open event:

If Forms!YourForm!YourTextBox = "Staff" Or etc. Then
Cancel = -1
End If

Alternatively

Select Case Forms!YourForm!YourTextBox
Case "Staff", "etc."
Cancel = -1
End Select

This code will not allow the departments in your condition statement to open the form. Of course, you could be even more specific by allowing some to open the interface as read only or to lock certain textboxes. It can give you a lot of leeway.

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top