Users

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

Guest

I have a purchase order form which has an employee logon feature. In the form
it has employee so that we can keep track of who ordered what. how do i tell
it to automatically put in the employee that logged in is this possible?
 
You don't really tell us how they log on.

If you are using the built-in User Level Security, then you can capture the
ID using...

CurrentUser()

You can use that in code or even as the default value for your field.
 
If you're not using user-level security, you can use the code at
http://www.mvps.org/access/api/api0008.htm to get the network login ID of a
user.

You can set the default value for the control in your form (which I assume
is bound to the appropriate field in your table) to the login name by the
following, in the form's Open event:
MyControlName.DefaultValue = """" & fOSUserName() & """"

or, if you are using Access user-level security:
MyControlName.DefaultValue = """" & CurrentUser() & """"

This will allow the name to be edited on the form. If you don't want that,
you can either disable or lock the control, or simply hide it.

HTH,

Rob
 
Back
Top