Limiting Displayed Records

D

Duncan Edment

Hi all!

I've implemented User Level Security in a departmental
Access 2000 database. However, now what I want to do, is
take the id of the currently logged user--CurrentUser I
believe--and retrieve from the database, only those
records that relate to the currently logged-on user. But,
if I log in--as database Administrator--it should show me
all records.

Can anyone advise?

Many thanks for your help.

Duncan
 
A

Arvin Meyer

Duncan Edment said:
I've implemented User Level Security in a departmental
Access 2000 database. However, now what I want to do, is
take the id of the currently logged user--CurrentUser I
believe--and retrieve from the database, only those
records that relate to the currently logged-on user. But,
if I log in--as database Administrator--it should show me
all records.

Base your form or report on a query which contains the column with the
user's login name. In the criteria box for that column use the CurrentUser()
function, something like:

Select * From tblWhatever
Where UpdatedBy = CurrentUser()
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
D

Duncan Edment

Thanks Arvin. Problem solved!

Duncan

--
Do not walk behind me, for I may not lead.
Do not walk ahead of me, for I may not follow.
Do not walk beside me, either.
Just leave me the hell alone.
~ Anon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top