×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Auto Tracking of Operator Id

Auto Tracking of Operator Id

Auto Tracking of Operator Id

(OP)
Wishful thinking, but is there a way to have the operator id in a table set to the operator who created the record (their signon id) e.g. using the default property, etc.
I know how to do this in a form but there are quite a few forms that would require changing as well as updating the changed forms on many computers.
Thanks Alex

RE: Auto Tracking of Operator Id

Yes you can do this.  If you know how to build a function that does this for a form you can set the default value of a table to a function.

 so build a function
  public function getPK() as string
    'some function here to determine the user name
    'determine the last id in table
    'create a new key
  end function

in the table default value
  =getPK()

However if you are currently using an AutoID you can simply add another field for UserCreated in the table.  Set the default for that field to a function that returns the user.  There really is not a good reason to make the PK contain the user id.  Just let the PK be unique and have another field for user.  You can always concatenate this info for visibility.   

RE: Auto Tracking of Operator Id

FYI.  I have not seen it yet but I have read that 2010 has table level events called data macros.  So lets say you wanted to track the last person working the record.  Currently you can only do that at the form level.  But data macross would be like you were asking were the event would occur whenever table is effected.  See here:
http://blogs.office.com/b/microsoft-access/archive/2009/08/13/access-2010-data-macros-similar-to-triggers.aspx

Anyone using these in 2010 have info/opinions?

RE: Auto Tracking of Operator Id

(OP)
MajP, thank you for your help. I will give this a try. Unfortunately we are still at Access 2003 but will definitely keep this in mind for the future. So much easier than changing forms all over the place.
Regards Alex

RE: Auto Tracking of Operator Id

Alex,
  I think I gave you bad information.  I do not have Access on this computer to double check.  However, I know you can use a vba function as a default table value.  Example in a date field you can create a time stamp
 = now()

However, you might not be able to use a User Defined Function (UDF). You will then have to use vba functions for the default value. You may want to test
=Environ("username")
and see if the passes the user name.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close