"stamping" records by user

M

MCB

I don't think this is quite the same as the user tracking questions that've been asked, but if so, my apologies

In Access 2000, I have set up a workgroup with two levels of permissions. All users are assigned to one of two groups. What the powers that be have now asked for is basically an "entered by" field on the form where users create a new case record (this database is medical-related). I could do this manually, by making a drop-down list of usernames and making it mandatory for the user to select his/hers when a new case is created, however, that's clunky, and has little protection against errors (e.g. selecting the wrong name)

Is there any way to grab the username from when the user logs in to the database, and have that automatically populate the "entered by" field when the user creates a new case? (Presumably a form of lookup.) Ideally, I don't want to do this in VBA if I don't have to, since I have nearly zero experience using it, and have had no luck getting anything to work in it when I've tried.

Thanks in advance.
 
R

Rick B

Just enter =curentuser() in the timestamp field's default value, or
use code to place it there. Personally, I would use code on the before
insert to put the userid, date, and time.

Do a search if you would prefer to grab the login name from Windows and use
it.

Rick B


I don't think this is quite the same as the user tracking questions that've
been asked, but if so, my apologies.

In Access 2000, I have set up a workgroup with two levels of permissions.
All users are assigned to one of two groups. What the powers that be have
now asked for is basically an "entered by" field on the form where users
create a new case record (this database is medical-related). I could do this
manually, by making a drop-down list of usernames and making it mandatory
for the user to select his/hers when a new case is created, however, that's
clunky, and has little protection against errors (e.g. selecting the wrong
name).

Is there any way to grab the username from when the user logs in to the
database, and have that automatically populate the "entered by" field when
the user creates a new case? (Presumably a form of lookup.) Ideally, I don't
want to do this in VBA if I don't have to, since I have nearly zero
experience using it, and have had no luck getting anything to work in it
when I've tried.

Thanks in advance.
 
G

Gerald Stanley

Here is an idea that requires no use of VBA.
Add a textbox to the form and set its controlSource to your
new column 'enteredBy'. Set its visible property to No and
its DefaultValue to =CurrentUser()

That should populate the new column with the id that the
user used to open the database without the user having to
do anything extra and they cannot lie.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I don't think this is quite the same as the user tracking
questions that've been asked, but if so, my apologies.
In Access 2000, I have set up a workgroup with two levels
of permissions. All users are assigned to one of two
groups. What the powers that be have now asked for is
basically an "entered by" field on the form where users
create a new case record (this database is
medical-related). I could do this manually, by making a
drop-down list of usernames and making it mandatory for the
user to select his/hers when a new case is created,
however, that's clunky, and has little protection against
errors (e.g. selecting the wrong name).
Is there any way to grab the username from when the user
logs in to the database, and have that automatically
populate the "entered by" field when the user creates a new
case? (Presumably a form of lookup.) Ideally, I don't want
to do this in VBA if I don't have to, since I have nearly
zero experience using it, and have had no luck getting
anything to work in it when I've tried.
 

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