Link to home
Start Free TrialLog in
Avatar of Czher
Czher

asked on

USERNAME as USER PROFILE

Hello experts,

I have a project that's going to be used by several users, some of the user (X) will be incharge of giving/writing a task for specific user and most of the user (Y) will view and update the progress of the task assigned to him, the project is password protected, each user has its own username and password, my question is, how i can make the username as their profile and show only what he (X) created task and assign to (Y), and (Y) will see only the task assigned to him and update.

I hope that my question is clear.

Thanks in advance
Avatar of pritamdutt
pritamdutt
Flag of India image

Which application/tool are you using? Sorry couldn't figure that out..
Avatar of Czher
Czher

ASKER

Pritamdutt,

I'm using MS Access
You could VBA Code to retrieve current username assuming they are logged on using it.

The sample VBA code is available on the Microsoft Site at the link given below:

http://support.microsoft.com/kb/161394
Avatar of Czher

ASKER

but where i will put that code?, can you please give me some example

thanks
I do this on one of my databases.

Can you upload your database and tell us which forms your want filtering by user.  Then we can give you the exact code you need
You can create a VBA Module in Access to put the mentioned code and make a call in your Project to make a choice on options to displayed to the user. This could be used by doing a cross referencing with list of users in another table and mapping them with their respective roles.

So essentially this would mean:
1. When Access application starts you check the logged on user name
2. You make query to access table to identify role assigned to the user
3. You display forms/options available to that role such as Project Manager

Hope this helps.
Avatar of Czher

ASKER

jdc1944,

i attached the sample mdb similar to my project.

have a look on it and tell me what i need to do.

Thank you so much

Czher
PMSys.mdb
Just had a quick look over it.

You would only need one query/form for users Y, Z, A and B.  We'll call this frmUser_Home.
On this add an unbound text box and rename it txtUser. (you can set its Visible property to false if you dont want the users to view this, and make sure that the Locked property for this text box is set to true so users cant put in another users username).

Copy the code given by pritamdutt into the on Open event for frmUser_Home.  Replace the code at the bottom where it displays the user name in a message box so that it assigns it to the text box on the form instead, something along the lines me.txtUser = lpUserName.

You may then have to get it to refresh the form after this e.g me.frmUser_Home.requery

Then in the query for this form, in the username criteria add a reference to the textbox on the form which stores the username e.g [forms]![frmUser_Home]![txtUser].

This way it will only display records associated with the username that is in the textbox on the form which is automatically populated when the form opens.
Avatar of Czher

ASKER

how about the user X and W?

can you please do it on the example i attached?

Thank you
are you setting up users username and password through the User-Level Security Wizard
@Czher : I understand that you require the application to manage projects for you.

For a easier project management the entire Team can be divided into specific role groups e.g.
- Project Manager
- Team Leader
- Developer
- Tester
- Designer
and heceforth.

This hierarchy is dependent on the type project you are planning to manage.
With this in mind these are the following steps required to be done
1. Classify all users into appropriate role
2. Create a Table of Users
3. Create a Table of Group/Roles
4. Create a Table for User and Supervisor Mapping
5. Design Forms for Specific groups as they would most likely have similar requirements
6. On application launch call the VBA function to Identify the User
7. Lookup the User Role/Group from the mapping table and display the relevant screen/form
8. Based on UserAndSupervisor mapping table you could display the direct reports of the supervisors for giving assignments.

Hope this logic will help you build your desired application.
Avatar of Czher

ASKER

jdc1944,

I have a different username and password setup, i didn't use the wizard
What setup did you use?  The code from MS supplies the username of the user logged into the computer, not the user logged into the database which means we'll have to try something else but until i know exactly how you have set up the security i cant do that.
Avatar of Czher

ASKER

i created a VBcode, where i group the users and put access level to each group , enable some module to a user which permits them to use and disabled other module which prohibits them to access,
now in this case, the project that i'm doing, what i need is not a group of users but individual access, for example user X will write the task for user Y and Z, but user W will not see or dont have access to view what user X assign to his subordinates (Y&Z) and vice versa, for user Y,X,A,B will see only what task asign to each one of them and not to see other task.
I presume in the code you have written there will be some sort of variable where the username is stored, otherwise without that you wont know which group the user belongs to, right?
@Czher you are on right track.

- As a next step, following are scenarios for you:

1. Assign Task
- Create a Query to Select List of Assignable Users
In case of X the list of Assignable Users will be Y and Z
The queries could be
//List Assignable Users
Select * from Users where ReportingTo=X

//Assign Task
Insert into Tasks (TaskName,AssignedTo) Values ("Task Assigned to Y", "Y")

2. List Tasks assigned
- Create a Query to List Task Assigned to an User
In case of Y .. query could be like
Select * from Tasks where AssignedTo=Y
and In case of Z it would
Select * from Tasks where AssignedTo=Z



I hope this helps...
Avatar of Czher

ASKER

can you please do it to the file that i attached, because i tried what you said in that sample, but it didn't came out as what i want to do.

Thanks
What issue are you facing.. Can please upload the latest file with errors.
Avatar of Czher

ASKER

its not an error, what i mean is, the explanation that you just said is not the output that i want, or what i did is not correct, i dont know, that's why i'm asking you if you can do it to the sample that i uploaded, so that i can see your idea.

thanks
ASKER CERTIFIED SOLUTION
Avatar of pritamdutt
pritamdutt
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Czher

ASKER

Thanks