set default value for a textbox to the current user

M

Mark Kubicki

I'd like to set the default value if a test box to the initials of the
current user.

Currently I have the value set as =CurrentUser() which consistently
returns the value "ADMIN";
I thought that there was something in Microsoft where each users are
assigned a 3 letter ____,,, I think it's typically used when editing
documents in Word (mark my comments with __...) or in Outlook emails (mark
my replies with ___...); but I can't seem to find anything.

I could always ask the user to log-in when opening the database, however,
while the need keep a record of who edited what is useful, I don't want to
make a "big" deal of it (it ought to happen tacitly in the background)

thanks in advance,
mark
 
D

Douglas J. Steele

Oops, just reread this, and see you want a default value. Unfortunately, you
can't use user-defined functions for default values. What you'll need to do
is put code in the form's BeforeUpdate event to set the value for the field
before the record is written to the database.
 
S

Sarah

What if you want to set it for the table? What I mean is, my users sometimes
do not use the form to do data entry. I have an older volunteer who refuses
to change to the form to enter the data. Is there any hope to be able to
track the user?

Thanks!
 
D

Douglas J. Steele

No, you must use a form.

You should never allow the users to work directly with the tables.
 

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