Current User problems

B

bilbo+

Hi there, I have a dropdown filed that is locked on a form, with the options
of the 5 different users on the sydstem. i hav put the default value as
=CurrentUser()
now im guessing this is probably wrong since i get error messages when
different users go bac kto the form... What I basically want to do is that
whenever a new record is created it puts that user id into that record and
locks it to it so it cant be cahnged, but i want nothign to change when other
people look at the record, so in effect i want lieka user stamp of who
created it attached to the record... Can anyone help?? Thanks i nadvance... WK
 
B

Barry Gilbert

What error messages are you getting? Your approach sounds reasonable, but I
don't think you need a dropdown list. I think you could just use a textbox
(locked) with a default value of CurrentUser(). This should only insert the
value when a new record is created.

Barry
 
K

Klatuu

Based on your post, it sounds like you have multiple users sharing the same
mdb file. It is always better for each user to have their own copy.

My approach would be to have not controls visible on the form that related
to that field. I would just create an invisible control bound to the field
where you want to record the user, and make the Default Value of the control
= CurrentUser().
If you want it to be visible, instead of Visible = No, make in Locked = Yes
and Enabled = No. In either Case, set Tab Stop to No.
 
R

Roger Carlson

On my website (www.rogersaccesslibrary.com), are a couple of small Access
database samples called "AuditTrail.mdb", and "UserSeesOnlyHisRecords.mdb"
which might help. Neither does exactly what you are looking for, but some of
the methods could be adapted. In particular, they both show how to correctly
identify the correct current user.
--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


bilbo+ said:
Hi there, I have a dropdown filed that is locked on a form, with the options
of the 5 different users on the sydstem. i hav put the default value as
=CurrentUser()
now im guessing this is probably wrong since i get error messages when
different users go bac kto the form... What I basically want to do is that
whenever a new record is created it puts that user id into that record and
locks it to it so it cant be cahnged, but i want nothign to change when other
people look at the record, so in effect i want lieka user stamp of who
created it attached to the record... Can anyone help?? Thanks i
nadvance... WK
 
Top