User name

C

Cheryl Fischer

To expand a little on Van's response, CurrentUser() will return the user
name if your database has implemented Access Security. If you're not using
Access Security, you would need to add some code to your database, which can
be found at:

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

hth,
 
A

Alan Bornat

Cheryl, your code returns the user logon name which is good, but I was looking for something like the Office user name which could be written to as well as read
 
C

Cheryl Fischer

CurrentUser() will return the Access User Name *if* you have implemented
Access Security; otherwise, it will return the default user name of Admin.
If you do not have Access Security implemented, the next available method of
getting the identification of the person (without having some other perhaps
custom login to your database) is the Network User ID. Are you asking
about development of a custom login scheme?

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Alan Bornat said:
Cheryl, your code returns the user logon name which is good, but I was
looking for something like the Office user name which could be written to as
well as read
 
J

Joan Wild

Not through Access - there is no equivalent 'username' like in Word. You
could set a reference to the Word library and retrieve it.

Word.Application.Username

--
Joan Wild
Microsoft Access MVP

Alan Bornat said:
Cheryl, your code returns the user logon name which is good, but I was
looking for something like the Office user name which could be written to as
well as read
 
D

Dev Ashish

I was looking for something like the Office user name which could be
written to as well as read

As Joan and Cheryl have pointed out, there's no such property in Access.
The closest you can get within Access/DAO object model is to either use the
'Author' property off of the SummaryInfo document (which I won't recommend)
or define your own custom property in the Custom tab (off of the
UserDefined document following the same syntax).

?CurrentDB.Containers("Databases").Documents("SummaryInfo").Properties
("Author").Value

-- Dev
 
A

Alan Bornat

Thanks - in Word Help it says 'The information you type in the User Information dialog box is used by all Office programs' - so I was hoping to be able to access it through Access!
 
A

Alan Bornat

Thanks for your reply - no, I was just asking how to get the user information which is stored somewhere in Office - for example it says in Word help 'The information you type in the User Information dialog box is used by all Office programs'
 

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