any ideas?

icemonster

Registered User.
Local time
Today, 10:01
Joined
Jan 30, 2010
Messages
502
ok.

i have a question, i have seen examples of this but whats the best way to limit a users option when it comes to viewing records? like example, if the user is from new york, he/she only see's new york files, while those back in chicago hq, can see all the files from all over the place. what's the best option? thank guys.
 
How does Access know where a user is from?
Do they 'login' to an account that stores their location in a table?
Do they choose their location from a list?

If either of these scenarios could be used, then it's an easy matter of building a query that returns only records with a matching location.
 
You need to build in some sort of RBAC (Role Based Access Control). When a user is added to the user table have a field that signifies what they can and cannot see. Such as "NY" or "DC" or "*" (for all).

Then when the user logs in it stores this value to a public variable and uses it in the app to act as a filter option. This takes alot of modification if working on a post production database, however new ones are easier as you employ the rules as and when needed.
 
by default access doesnt know this

even if you do not turn on access security, all users ACTUALLY login to access as user "Admin".

so, you can either turn on access user level security, so that users login through that (but this may not be available in A2007 - not sure) - or you can implement something yourself - either with your own login process, or by testing a newtwork/domain login name, for instance

even then, a "horizontal" control needs a lot of work. access is in general allows any user to see all data, and you just control the users ability just to open certain forms etc - sort of a "vertical" approach. It doesnt lend itself directly to any inherent system that limits users to viewing a subset of data through any given form. You have to manage that yourself.
 
well, RBAC would be a good idea but dont really know how to do it, and to evanscanman, it would be more to do the query, because then i would have to do a form for that query and i have 13 locations :d lols.

the tblemployee has a site location, that would be the filter on their viewing options.
 
You've got a point there - Access isn't going to write it for you, you'll have to do some work - but it's certainly doable.

I shouldn't be any harder with one location or thirteen - make the query and form once. Sounds like your table structure is already good to go.

Just add a splash screen with a log-in. It won't be 100% secure, but if that's not a big deal this should be pretty easy.
 
First, determine who you are talking to so that you can look up their "locale" in some table behind the scenes.

Second, dynamically build a query string to be loaded to the rowsource of your combo box or list box that includes in a where clause, "... AND [LOCALECODE] = " & CStr(MyLocCode) & " AND ...." whatever other criteria. Then requery the combobox or list box.
 
one way ive seen, is to have a text file which acts as a sort of ini file

read this on opening, and then the queries that select the data to display, need to use a value collected from the ini file to determine the subset of data to be shown.
 

Users who are viewing this thread

Back
Top Bottom