Date Created and Created By

  • Thread starter Thread starter Guest
  • Start date Start date
Date created is easy. Just add a Date/Time field to your table, and set its
Default Value property to:
=Now()

As for who created the database, what user name do you want? If you are
using Access security where everyone signs in with a user name and password,
you could use CurrentUser(). If not, you could use the Windows user name.
Code here:
http://www.mvps.org/access/api/api0008.htm
Either way, use the BeforeUpdate event procedure of the form to assign this
value to the Text field you created.
 
I am having a hard time with the code on your page. I copied all of it and
put it into the before update event. I am getting an error code from Access
that says that only comments may appear after end sub and so on. What am I
doing wrong?
 
The code from the MVPs webside article has to go in a standard module (i.e.
one created by clicking New on the Modules tab of the Database window.)

In your form, you can then use:
Me.CreatedBy = fOSUserName()
 

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

Back
Top