Need code to get Win logon userid

  • Thread starter Thread starter David
  • Start date Start date
D

David

I need the code to access the Windows logon id.
I know it exists because I used it before but now I've
forgotten where I got it.

We currently use a mix of Win NT and Win 2K but will
shortly move to Win XP, does this code work for them all?

- David
 
Thanks!
Do you know if its possible to populate a table column
with this via the DefaultValue in table design.
I tried =fOSUserName() there and I got a message 'function
not found'.
- David
 
David,

As far as I know, one can only use Access' built-in functions as default
values in table design. You might want to consider doing a little DAO code
to get the value into a table.
 
You can use user-defined functions as defaults in forms (and in queries if
you're running inside of Access). Since you should never be updating tables
directly, that should do the trick.
 
Back
Top