Time Stamp Question on Field

M

marf

I have a table where I store weekly updates for stuff that people are working
on. Many people have access to the database, so I would like to capture the
time and id of the person who updated the record. The field in the record is
of type memo...

Can someone please help me set up those colums and attributes.

Thanks
 
W

Wayne-I-M

Hi

You should "never" allow user to work directly in the table. Use a form or
query.

Create a table with all the staff members
Create a table to store the timestamp detail (user's ID, Now() or Date(),
record ID)

Use the after update event of a combo on the form or query (not table) to
pass the user ID to the timestamp table andinsert Now() or Date() into the
timestamp field

Force user to select themself from a combo before the form can be altered -
maybe include a password field to log into the form - and use this to pass
the userID to the table.
 
K

Klatuu

As Wayne said, users should not be working directly in tables. The fact is,
there is no way to enforce entering anything directly in a table except
making the field a required field. You can make the field required and give
it a Default Value, but that really doesn't keep them from changing the value.

The better solution is to use a form. You could have a user table or, you
can capture the user's network login ID and use that. Here is a link where
you can download a function that does that:

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

Now, to ensure it always get in the table and the user can't change it,
create two text box controls on your form and bind them to the appropriate
fields in the table. Then set the Visibility property for both controls to
No. That way, the user will never event see them. Now to get the data into
the tables, use the form's Before Update event to to populate the controls
Me.txtUser = fOSUserName()
Me.txtTimeStamp = Now()
 

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