Results 1 to 8 of 8
  1. #1
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53

    User login difficulties


    I am a new user Access 2016. I have started a project, for creating sales receipt. I have used a login form and got the current user name. I want to use the current user in the sales receipt form. Actually I have added the username, from the login query in my form. Now my problem, is I am not able to hold the value in the form, because the value of the field in all previous records changes to the next user login name. So all my user field in all records show the current user only.
    How do I add the user name, and the username remains in the record permanently, so that I can filter records based on the user.
    I am not good in codes, so kindly suggest to use with formulas and macros. Thanks

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Data is stored in tables not forms. So you need to add a username field to your sales table and use a bound control for that field on your form.
    Use a function to get the username from the login form and to populate that field in the table.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53

    Populating login field

    Quote Originally Posted by isladogs View Post
    Data is stored in tables not forms. So you need to add a username field to your sales table and use a bound control for that field on your form.
    Use a function to get the username from the login form and to populate that field in the table.
    Thank you very much for your response. ok. I added a username field in the main sales table.

    Now, I am not very sure, what kind of function to use, to bring the current username, to the sales table.

  4. #4
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    on the form you can set the default value of the text box bound to the new field to Environ("username") .

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    If the user logs in with their Windows username then you could use e.g. Environ("UserName")

    Otherwise, you could use a global variable strUserName (or a TempVar)
    Set this equal to the username entered in a textbox on your login form so the value is stored whilst the user remains logged in

    When the user opens the sales form, populate that field with the saved user name
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53
    I set a default value in a txtbox in the form. Done.
    thanks and Merry Christmas

  7. #7
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53

    Accessing pictures in forms in LAN environment

    Hi,

    My access 2016, database with FE and BE. I copied FE in another computer- connected LAN. When I operate the FE in the network computer, I am not able to get the images in the form. My images folder is in the 1st computer. Whereas the images appear in the 1st computer. I am missing some links. Thanks

  8. #8
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53
    I found the correct linking of the file path. solved. Thanks

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

Similar Threads

  1. Block a user to login
    By rcoreejes in forum Access
    Replies: 3
    Last Post: 07-03-2013, 11:20 AM
  2. User Login Form
    By glen in forum Forms
    Replies: 21
    Last Post: 09-17-2012, 09:09 AM
  3. User Login
    By winterh in forum Forms
    Replies: 6
    Last Post: 03-14-2012, 06:01 PM
  4. Multi- User Login
    By Tom Lovick in forum Access
    Replies: 1
    Last Post: 02-11-2012, 12:20 PM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 PM

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