Results 1 to 9 of 9
  1. #1
    jmjbear is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2011
    Posts
    5

    Password Authentication

    Currently I am working on a database that I am trying to use password authentication.....



    .mdb file - Password authentication is working and I can get it to send the login ID over to the form. With the form I am going to use it to make record entries for a specific user that is logged in. Criteria needs to be based on the employees name and current date (date() already set). But all it is displaying is the Employee ID instead of the Employee Name.

    So what I am needing is not only to display the Employee name, but set it as the value of the text box when the form opens so I can use it inconjuction with the query. The control source of the form is the query, so when it comes up, i want it to already check and see if there is data for that employee for the same date, and allow them to update it so it updates the record.

    I have attached the database. Please advise of a different method of VBA coding or something specifically that should be changed. Before I tried this method I was going to use global variables to define the user id as a global variable. At that point I could make it display the user but not use it as criteria for the query. Is there a way to have the query use the global variable as criteria outside of the form since the global variable would have already been defined? Which ever way would be easier, that is what I am about. Please help if possible. .. thank you very much for the help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Here is another approach https://www.accessforums.net/program...ion-19238.html

    User doesn't have to login to the database. User identification is from the network login. You can declare a global variable in a general module, populate the variable from the default open form and it will be available anywhere in the database. Beware, global variables can be annoying when trying to debug. My solution is to set a textbox on menu form that never closes with the user info.
    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
    jmjbear is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2011
    Posts
    5
    Quote Originally Posted by June7 View Post
    Here is another approach https://www.accessforums.net/program...ion-19238.html

    User doesn't have to login to the database. User identification is from the network login. You can declare a global variable in a general module, populate the variable from the default open form and it will be available anywhere in the database. Beware, global variables can be annoying when trying to debug. My solution is to set a textbox on menu form that never closes with the user info.
    How would I do that with a hidden form? Sorry for my novice questions

  4. #4
    jmjbear is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2011
    Posts
    5
    Quote Originally Posted by jmjbear View Post
    How would I do that with a hidden form? Sorry for my novice questions
    The reason I didn't use the network login.. there will be times that a user is at a different users pc to make the entry.. what I have now, have a drop down box where they choose the user and the enter the password. The autonumber id (hiddenI part of dropdown)goes thru but not the employee name..

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    I am not understanding why you need the employee name. It is the employee ID that is saved in Data table. Even though you have named this field EmployeeName and set it as a text datatype, you have saved the EmployeeID. The lngEmpID field in tblEmployees is an Autonumber datatype. You will not be able to join these tables because these key fields are different datatypes. You need to fix the Data table field to be a number datatype.
    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
    jmjbear is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2011
    Posts
    5
    That is just the thing, I want to actually enter the Employee Name into the Data table instead of the ID. Those entries were where I was trying to make it work. Is that possible?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    That is source of my confusion. Why save the name? You can always retrieve the name by joining the tables in query. What if you have more than one employee with same name? If you are positive that can NEVER happen then can set the employee name field as primary key (as primary key, duplicates will not be allowed). Then the ID field is not needed in table and not in combobox RowSource. The name will be the combobox value. You show only first name in table. You don't want last names?
    Last edited by June7; 11-27-2011 at 02:04 PM.
    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.

  8. #8
    jmjbear is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2011
    Posts
    5
    As far as the names, when the datasbase itself is implemented it will be first name, middle init, and last name. As far as duplicates, that more than likely won't happen. If there is not an ID field and the Employee Name is the Primary Key how should I adjust the Dlookup to make it work correctly?

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Okay, based on that, I recommend you stay with the Autonumber EmployeeID field as primary key. There is nothing wrong with the DLookup. Change the EmployeeName field in Data table to number datatype and name it EmployeeID. Save the lngEmpID as foreign key in Data table. Make the employee name available by joining tables in query. If you have the name parts in separate fields, use concatenation to show as a complete name. So in the combobox RowSource the SQL would be:
    SELECT lngEmpID, LastName & ", " & FirstName & " " & Middle As EmpName FROM tblEmployees SORT BY LastName;
    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.

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

Similar Threads

  1. Password Form
    By hitesh_asrani_j in forum Forms
    Replies: 1
    Last Post: 09-26-2011, 06:13 PM
  2. Replies: 4
    Last Post: 09-14-2011, 12:33 AM
  3. VB Password
    By SAHeat6902 in forum Security
    Replies: 1
    Last Post: 09-30-2009, 03:13 AM
  4. ***PASSWORD HELP***
    By hawkinsgal in forum Access
    Replies: 2
    Last Post: 11-23-2006, 09:10 AM
  5. Change from old password to new password
    By richy in forum Security
    Replies: 0
    Last Post: 11-17-2005, 05:05 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