Saving User ID for each record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

On my form I have a field called Employee Name. I used some code that I
found on another thread to capture the User ID of the person who opens the
database. Everything works great except for one thing, when I click back to
previous records it shows who ever is logged in at the time on all the
records. How to I get the user name to appear when the database is open and
save that name to that record so when some else opens the database, their
will not show on that record.

I knew something wasn't going to work right, it was going too easy.

Thanks!!
 
You need to put the UserID in that field in the "before insert" event for
the form. Sounds like you simply have a text box and you are displaying the
current UserID.

Note that I said you need to put that value in the FIELD before insert. You
have to actually have a field in your tale where you save this.

If it were me, I would lock that field down so the user can't modify it in
any way.
 
Hi Rick,

Thank you for responding. I am not sure I understand what you are saying?
You are correct, I have a text box that displays the current user ID and am
trying to get it to store to the table. However, I am a bit confused on your
answer. If I have a field called "Employee Name" on the form and also on the
table. Are you saying I need to put the code I am using to show the current
user in the "before insert" event of the form? I'm also not sure what you
mean by place value in the field before insert? I apologize, but my
comprehension of access is not as up to par as a lot of you guys who solve
these problems. Could you please clarify and break it down a bit for me?

Thanks!
 
Back
Top