Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Get Login Name (2003/SP1)

    You don't implement it from the table. It is implemented in code in the forms that present the data to the user. Users should never have direct access to tables, or even to queries, if possible. You can create a text field in the table to hold the username, but you only retrieve the value and insert it into a record when the user interacts with the record through a form.
    Charlotte

  2. #2
    Lounger
    Join Date
    Jan 2005
    Location
    Jacksonville, North Carolina, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get Login Name (2003/SP1)

    Thanks again Charlotte [img]/forums/images/smilies/smile.gif[/img]
    I'm still a little lost on how to call the module. I changed the field to a text box in both the form and the table, but I'm not sure how to get the module to work with the text box. I apologize for my ignorance in advance; this is my first project on my own, and as you can tell, I'm as novice as the come. [img]/forums/images/smilies/wink.gif[/img]

  3. #3
    Lounger
    Join Date
    Jan 2005
    Location
    Jacksonville, North Carolina, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get Login Name (2003/SP1)

    Well ... I managed to get something ... I think. I put in =fOSUserName() as the default value in a text box in the form. When I toggle back to form view the text box says #Name?
    I'm hoping that it's because I'm not on a domain, therefore it doesn't have any login information to retrieve. I'll bring it into work tomorrow to test that theory, but any advice is greatly appreciated.

    Thanks again Charlotte,
    That's two beers I owe you (... btw ... do you even like beer?)

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Get Login Name (2003/SP1)

    Is fOSUserName() the name of the function or the module? They can't be the same name, and the one you want to call is the function. Module names are for your convenience and are only significant in a class module.
    Charlotte

  5. #5
    Lounger
    Join Date
    Jan 2005
    Location
    Jacksonville, North Carolina, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get Login Name (2003/SP1)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Hello all,
    I'm attempting to create a field in my database that will retrieve the current user's login name from the OS. I've found a great source for the code (see http://www.mvps.org/access/api/api0008.htm -- A million thanks to Dev Ashish), but I'm not sure how to implement it within the table. I did as the page said and created the module with the name fOSUserName. Now I just need to know how to call the module for a default value and what kind of field it should be (ie. text box, ole object, lookup, etc). [img]/forums/images/smilies/tongue.gif[/img]

    Help me Obi Wan [img]/forums/images/smilies/wink.gif[/img]

  6. #6
    Lounger
    Join Date
    Jan 2005
    Location
    Jacksonville, North Carolina, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get Login Name (2003/SP1)

    Sorry to keep you hanging Charlotte [img]/forums/images/smilies/sad.gif[/img] I appreciate your help with this.
    To answer your question, I had the module named the same as the function because I didn't know what a function (or a module) was. I think I have a basic understanding of what they are, however I wouldn't agree to a pop quiz on it [img]/forums/images/smilies/wink.gif[/img]
    Now I just need to find the correct syntax to use in order to call the function. I have to be shoving off to work, but I'll play around with it and see what I can come up with.

    Thank you Charlotte,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •