track what users entered

T

Todd

My dbase is secured and I'd like to be able to see who entered records in the
database. Is it possible to add a field in an underlying table to show who
entered a new record for that table or who last modified a record in the
table? I guess it would be like adding a date/time stamp in a table field:
now() that shows the date and time a record was entered. Help!
 
J

Joan Wild

The CurrentUser() function will return the Access username. You can't set
this as a default in the table, but in any forms you can include the field
that would hold this information (hidden if you like). You can set the
default value for a control bound to this field to =CurrentUser().

If you want to store the last modified by, you can use the Before Update
event of a form to set the ModifiedBy field to CurrentUser().
 
T

Todd

Thanks, it works great!
--
Todd


Joan Wild said:
The CurrentUser() function will return the Access username. You can't set
this as a default in the table, but in any forms you can include the field
that would hold this information (hidden if you like). You can set the
default value for a control bound to this field to =CurrentUser().

If you want to store the last modified by, you can use the Before Update
event of a form to set the ModifiedBy field to CurrentUser().
 
T

Todd

What do I do to record modifiedby. I added a field in the table called
modifiedby and just added it to the form and put currentuser() in the Before
Update property but it didn't work. Should I have entered it in the before
update property differently?

The currentuser() in the default property worked with newly entered data.
 
J

Joan Wild

In the BeforeUpdate event for the *form* put [Event Procedure], click on the
build button and put
Me.ModifiedBy = CurrentUser()
between the lines presented.
 
T

Todd

Thanks, it works great!
--
Todd


Joan Wild said:
In the BeforeUpdate event for the *form* put [Event Procedure], click on the
build button and put
Me.ModifiedBy = CurrentUser()
between the lines presented.
 

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