Report for CurrentUser()

  • Thread starter Thread starter Emma
  • Start date Start date
E

Emma

I have a report which opens from a macro. I would like only the CurrentUser()
to show. The field in the Record is called Intake Coordinator. I tried to use
the where clause and put [Intake Coordinator] = CurrentUser() in the macro
but it still openned the report with every Intake Coordinator's name. Any
thoughts?
 
CurrentUser() is a function which returns admin for every user in an
unsecured database. Access 2007 format databases have no user level
security.

What I do is build a table of Windows usernames. I then use the UserName API
to get the logged in user:

http://www.mvps.org/access/api/api0008.htm

And create a field in each main table which must return a specific user to
store that logged in user. Your Intake Coordinator field, should do that
just fine, but you'll need to make sure the data matches the values returned
from the function. In the form, you can add the textbox from the table field
and set the defaultvalue to the function:

= fOSUserName()

or you can write it to the textbox in the form's BeforeUpdate event or the
table in the form's AfterUpdate event. In your query, you will use the
fOSUserName() function as a criteria in the Intake Coordinator field.
 

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

Similar Threads


Back
Top