Trying to write Update time and Username to table

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

Guest

I am using Access as the front end and SQL as the DB. I have a form that
updates values and when the user changes the values and hit update, it writes
the updated values to the db table. I need to have the "user" and "time"
written to the table as well. is there some code i can use to do this. I
guess it would have to coincide with the user using windows authentication
when logging in.
 
I'm not sure the SQL database issues, but in Access I use either date() or
now() as the default value in the table definition. I'm not sure if that
works in a linked table.

If not, you should be able to use the form before insert or before update
event to write the values you want to the fields.
 
If the front-end has security then you can use the CurrentUser() to get the
id of the current user. Otherwise you could use the code found at
http://www.mvps.org/access/api/api0008.htm to get the network user name of
the person logged into the current computer.

The date/time info can be pulled by either the Date() or Now() or
Format(Now,"hh:mm:ss").

The you simply need to add there values to your update query.
 
Back
Top