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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]How can I Filter Data Access Pages by User/Department[/b]

Status
Not open for further replies.

Iashia06

Programmer
Jan 13, 2006
19
0
0
US
I have an MS Access application that contains 3 data access pages (DAPs). The purpose is for department heads to record and track projects and their activity. I would like to limit the pages so that each department head may view only the projects that are relevant to their department. Currently all users are able to see all the records in the database. How can I limit them to seeing only the records for their department?
 
1. Record their username with one of the functions I link to in (Getting all types of Usernames in Access faq181-3779).

2. Have a table with two columns: Username and Dept.

3. Make a query called "qryAvailableDepts" that pulls all departments where username = GetUsername().

4. In your form's data source, link to qryAvailableDepts on the department field.


You are done, and this will be totally transparent. I've left the steps somewhat vague because it's harder to get more detailed without specifics.
 
Also please don't use the
Code:
[b]tags in subject lines because they do no good at all, like this line[/b]
 
pseale's idea won't work. He's not working with forms, he's working with web pages (html) called DAP's in access. Also, I thought I gave a way to do this.
 
I tried to use the way you gave me but it didn't work.
 
The best way to accomplish this is to create parameric queries and create DAPs based on these queries. In a week or two you may see an example at
 
mysorian - you write the department head's ID to a cookie file and then subsequently read the file to retrieve the info to filter. I'll bet it's shorter then whatever's going to be on
 
I have also written a faq that may help. Just look at the one's I have done.

Never give up never give in.

There are no short cuts to anything worth doing :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top