Results 1 to 8 of 8
  1. #1
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34

    Connect User id to data entry

    Hi everybody,



    I am new to Access 2010 and would like ask as to how I can connect user id to entries made in the database/tables to particular user who has say logged in the system. I have seen many youtube videos but they dealt with how to create user login form.

    I would like to know how once a user is logged in, all the entries made by him should be related to this particular user and if somebody else login then the entry made by another user in the same table should be related to the another user.

    Also can anyone tell me how to set Tempvar variable as a default value in a table.

    Can anyone please guide me.

    Thanks

    Bharat

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Can grab the user's Windows username with: Environ("USERNAME"). No log in form needed. Can save that to record. Or use it to lookup user info in a Users table.

    I set a textbox with user ID on a form that never closes (MainMenu). Then VBA code saves the ID to record.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34
    Thanks for your reply.

    I have only few users and the method suggested by you is little complex. Is there any simpler way?

    Thanks

    Bharat
    Quote Originally Posted by June7 View Post
    Can grab the user's Windows username with: Environ("USERNAME"). No log in form needed. Can save that to record. Or use it to lookup user info in a Users table.

    I set a textbox with user ID on a form that never closes (MainMenu). Then VBA code saves the ID to record.

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    That is the simplest way.
    Also bear in mind that if person A uses your database on a computer where person B is logged into the network, all data changes will be logged to person B.
    This is going to be an issue if users share workstations.
    To prevent that issue, you use a separate login to your db with it's own login form.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Even a login form won't necessarily resolve that issue. If User A logs in and leaves db open and User B continues with the already open db (before Windows can lock the computer), User A will continue to be assigned to records. Code can do only so much. Users have to follow procedures. Log off when no longer working with db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    True. One solution is to forcibly log people out of the db after a set period of inactivity.
    But no system is totally foolproof
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Bharat,

    You have been given advice regarding your specific question. I note that you have 9 posts here and your post is concerning multiple users modifying the database and your wish to know who modified which record. You are asking about userIds, individual logins and a record of who did what.
    My question to you concerns database design since userids and logins will only work smoothly if your design matches your requirements and is implemented following database practices. What is your database about in simple terms? Can you tell us more about the business this database is intended to support?

    You may have seen these videos by Steve Bishop re user logins and managing user access to your data.
    https://www.youtube.com/watch?v=YQmy5tLn0kw
    https://www.youtube.com/watch?v=DxRpo496w_c
    https://www.youtube.com/watch?v=356ylQn6kkA

    Good luck with your project.

  8. #8
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34
    Hi Everyone,

    Thank you very much for your kind response.

    I shall try watching videos by Steve Bishop as suggested by Orange (Moderator) and then if I have any questions I shall come back.

    Thanks everyone once again.

    Regards, Bharat

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

Similar Threads

  1. Creating a database for end user data entry Access 2003
    By ethan.geerdes in forum Database Design
    Replies: 2
    Last Post: 02-19-2016, 08:23 AM
  2. Multi user data entry
    By FJM in forum Access
    Replies: 5
    Last Post: 01-07-2015, 02:27 AM
  3. Replies: 1
    Last Post: 11-29-2014, 12:23 PM
  4. Duplicate data entry on form level by user
    By Kananelo in forum Forms
    Replies: 1
    Last Post: 02-10-2012, 01:09 AM
  5. Replies: 1
    Last Post: 12-15-2011, 04:26 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