Share via

Environ("UserName") function in table default

Anonymous
2012-10-15T14:50:14+00:00

Hi.

I have recently discovered the function in Access 2010:

Environ("UserName")

This is perfect, but when I try and put it in the default section in table design it does not recognise it.

Do I need to put something before the Environ or can this function not be used?

I am trying to use it so I have an audit trail.

Thanks

Aaron

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2012-10-15T15:44:10+00:00

    Environ can have questionable reliability, in the sense that is can be reset through code.  You be better using http://access.mvps.org/access/api/api0008.htm

    As for your delema, you'd use this function in your form or directly in VBA, not in your table.  One way or another, no one should ever be entering any information directly in a table, so set it up through the data entry form.  One way would be using the Open event, or Current event where you could assign the value to a control:

    Me.ControlName = fOSUserName()

    Was this answer helpful?

    0 comments No comments