automatically insert a users network username in to a field

G

Guest

I have a database and I would like to add a feild that automaticly inserts a
users network Id (username) in to the feild so that I can keep track of who
put what in at what time.
 
G

Guest

Please see the following Web page for the VBA code to get the current user's
login name:

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

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
D

Douglas J Steele

Gunny's shown you how you can determine the current user's ID.

I wanted to find out more about your needs, though.

If you're hoping to be able to set this as a default field in a table, I'm
afraid you're out of luck. You can use that function to populate a field
through a form (or through a query that's run from within Access), but you
cannot use UDFs (user-defined functions) as default values for table fields.
 
A

Albert D.Kallal

but you
cannot use UDFs (user-defined functions) as default values for table
fields.


Yes, and I will add my 2 cents:

You *can* use a UDF for a default on a control on a form. And, since we
don't edit tables directly..then this is not such a problem....
 

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