How to insert SYSTEM_USER value into field on updates

D

David P. Lurie

Access 2003 adp
MSDE 2K SP3a

How can the current SYSTEM_USER value be inserted into a column on updates?

I was planning to use a form's before_update event for audit columns to
track the user and time of update with SYSTEM_USER and CURRENT_TIMESTAMP,
respectively.

The table in question has suser_sname() as the column default, which inserts
the SYSTEM_USER value into new records. There is no obvious VBA equivalent
function to use on column updates. CurrentUser won't work, as it has the
value "Admin" from Access, rather than the current SQL Server user.

getdate() as a column default works for a CURRENT_TIMESTAMP value on new
record inserts, and the VBA function now() is equivalent for updates.

Thanks,

David P. Lurie
 

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