Results 1 to 11 of 11
  1. #1
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237

    auto populating a filed

    im trying to auto populate an employee name field with it selecting the person who has logged in.... I can get the employeeID number but not the name any ideas?

    =[Forms]![LoginForm]![cboUser]

    on my loginform its combo box to select user which shows full name, I will only need the persons first name in the populated field.


  2. #2
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    if I change the bound column for the combo box to 2 which is the user name this works but it affects my coding for the DLookup for access levels

  3. #3
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	17 
Size:	109.8 KB 
ID:	32289

    this is the error if that helps

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Try:
    =[Forms]![LoginForm]![cboUser].Column(1)

    You may need to experiment with the column number. FYI the first coulmn is (0). The second is (1). The third is (2) etc
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by Bob Fitz View Post
    Try:
    =[Forms]![LoginForm]![cboUser].Column(1)

    You may need to experiment with the column number. FYI the first coulmn is (0). The second is (1). The third is (2) etc
    yeah that done it beautifully....... thanks for that!

    so ive got that on each form when opened and it displays their full name as logged in which is great. can I use this in fields for purchase orders so when a user creates a new order it inserts it, but cuts off the last name.

    I need the full name for logging in as there may be multiple first names but after that the first name is only needed.... is this achievable?

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Suggest that when the login is checked against the Windows login, you actually store the users unique ID (EmployeeID?)
    Then when needed later you just do a DLookup to get surname and/or first name .... or DOB or shoe size or whatever you want really ....
    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

  7. #7
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    Suggest that when the login is checked against the Windows login, you actually store the users unique ID (EmployeeID?)
    Then when needed later you just do a DLookup to get surname and/or first name .... or DOB or shoe size or whatever you want really ....

    are you suggesting a log in record sheet so to speak, to keep track of whos logged in? that's not bad idea if so not sure if its a must with our company though

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    are you suggesting a log in record sheet so to speak, to keep track of whos logged in? that's not bad idea if so not sure if its a must with our company though
    All I was suggesting is having a constant e.g. lngEmpID which is set when someone logs in based on their Windows login

    However, a login table is easy enough to do if its useful for other purposes,
    For example to keep a record of all current users.

    For example in this school database example I have a table called WhoseOn.
    An autonumber ID is assigned at login and stored in the table along with the teacher ID, date/time logged on and other items such as the workstationID
    When they log out the date/time logged out is also saved

    Click image for larger version. 

Name:	WhoseOn.PNG 
Views:	16 
Size:	55.5 KB 
ID:	32293
    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

  9. #9
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    its a good way of keeping track for sure.... but for what we do I don't think we need to go that far. the 1 workshop computer we have set up will be used by roughly 15 people but mainly to record when orders come in, would this still work or does every one need there own computer and windows log in for it to be successful?

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You don't NEED to do it at all
    IF you either of these on a shared computer, everyone would need to
    a) login to the app using a login form with user name & password
    OR
    b) login to Windows under their own 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

  11. #11
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    You don't NEED to do it at all
    IF you either of these on a shared computer, everyone would need to
    a) login to the app using a login form with user name & password
    OR
    b) login to Windows under their own name
    yeah ive set up login form for the app

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

Similar Threads

  1. Replies: 1
    Last Post: 02-10-2015, 01:04 PM
  2. Auto Populating a new form
    By mikejames in forum Access
    Replies: 12
    Last Post: 09-25-2011, 11:41 AM
  3. Number Filed in Form auto round
    By blueraincoat in forum Forms
    Replies: 9
    Last Post: 04-11-2011, 06:18 AM
  4. new guy with a question on auto populating
    By zdiver07 in forum Forms
    Replies: 2
    Last Post: 05-03-2010, 11:06 PM
  5. Auto populating date.
    By emccalment in forum Access
    Replies: 3
    Last Post: 02-19-2010, 11:00 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