?
Solved

USERNAME as USER PROFILE

Posted on 2011-10-05
21
Medium Priority
?
393 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:Czher
  • 9
  • 7
  • 5
21 Comments
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36916245
Which application/tool are you using? Sorry couldn't figure that out..
0
 

Author Comment

by:Czher
ID: 36916255
Pritamdutt,

I'm using MS Access
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36916407
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
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Czher
ID: 36916427
but where i will put that code?, can you please give me some example

thanks
0
 
LVL 2

Expert Comment

by:jdc1944
ID: 36916686
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
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36921924
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.
0
 

Author Comment

by:Czher
ID: 36922637
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
0
 
LVL 2

Expert Comment

by:jdc1944
ID: 36923230
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.
0
 

Author Comment

by:Czher
ID: 36923239
how about the user X and W?

can you please do it on the example i attached?

Thank you
0
 
LVL 2

Expert Comment

by:jdc1944
ID: 36924667
are you setting up users username and password through the User-Level Security Wizard
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36924782
@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.
0
 

Author Comment

by:Czher
ID: 36928483
jdc1944,

I have a different username and password setup, i didn't use the wizard
0
 
LVL 2

Expert Comment

by:jdc1944
ID: 36928997
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.
0
 

Author Comment

by:Czher
ID: 36929022
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.
0
 
LVL 2

Expert Comment

by:jdc1944
ID: 36929044
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?
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36929047
@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...
0
 

Author Comment

by:Czher
ID: 36946728
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
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36946738
What issue are you facing.. Can please upload the latest file with errors.
0
 

Author Comment

by:Czher
ID: 36946771
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
0
 
LVL 9

Accepted Solution

by:
pritamdutt earned 2000 total points
ID: 36947043
I hope you are not expecting me to design the entire application...

Never mind as a Proof of concept  I have done the following in your database

1. Added Following queries
- qryAssignTasks     - Append Query to assign Tasks
- qryEmployeeId      - Query to Findout Employee Id of Currently logged on User
- qryFindTasksAssignedToMe  - Query to Find out all the tasks assigned to me
- qryWhoCanIassignTaskTo - Query to Find out employees to who I can assign Taks
- qryWhoIsMySupervisor - Query to find out who is my supervisor

2. Added VBA code to find out UserId of Current user using the system

3. Update your Read Me First Code to
- Display Greeting to the Logged On User - Proof Of Concept that current logged on username can be identified
- Display Count of Tasks assigned and their list

Hope this helps!!!
PMSys.zip
0
 

Author Closing Comment

by:Czher
ID: 36947526
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question