Results 1 to 4 of 4
  1. #1
    Ganymede is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    64

    Creating User Profiles in Access 2007


    Let me start out by saying that I am not the least bit concerned with securing my database. However, because user profiles are a part of security (or at least that is the extent of my limited understanding of them) I am posting in this subform.

    All I want is for access to recognize the name of the person who is currently using the database. The reason is that I have a memo section that is used for storing notes made by the user. Each entry is stamped with VBA code as follows:
    Code:
    Me.Memo = Me.Memo.Value & vbCrLf & CurrentUser() & ": " & Me.Text145.Value & " - at " & Now() & " : "
    Thus, I just want the memo section to properly identify the person - or currentuser() - leaving notes.

    I have created a basic login screen using this. If only I could somehow tell VBA to recognize the name of the person who has logged on...

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The site you reference stores the logged-in user in a variable:

    lngMyEmpID

    You can access that variable from anywhere in code.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Ganymede is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    64
    Quote Originally Posted by pbaldy View Post
    The site you reference stores the logged-in user in a variable:

    lngMyEmpID

    You can access that variable from anywhere in code.
    Thank you! I missed the last part of his instruction about creating a module to store the variable. Doh!

    Anyway, even when I do that and I call the variable from code, it brings up the employee number (the key for the employee table) instead of the employee name. I don't see how it can do that when the code was

    Code:
       lngMyEmpID = Me.cboEmployee.Value
    And the value of the textbox was the employee name - not the employee number.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Well, the bound column of the combo is probably the ID and the name is in another column. You might want to also create a string variable and populate it with the name.

    strMyEmpName = Me.cboEmployee.Column(1)

    Or whatever the appropriate column is.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating Tables in Access 2007
    By leighkhonig in forum Access
    Replies: 1
    Last Post: 09-23-2011, 06:34 PM
  2. Student Access user, need help creating a table
    By racheliza79 in forum Database Design
    Replies: 3
    Last Post: 08-07-2010, 01:08 PM
  3. New access user -- help in creating a sub system
    By fidget_sane in forum Access
    Replies: 20
    Last Post: 04-22-2010, 11:46 AM
  4. how can i add a user with access 2007
    By ahmed-aljawad in forum Security
    Replies: 1
    Last Post: 04-16-2010, 02:50 PM
  5. How to add user-defined ribbon in access 2007
    By ali-gagi in forum Access
    Replies: 1
    Last Post: 07-02-2009, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums