Results 1 to 10 of 10
  1. #1
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14

    Code is not logging in. Please help me out

    I have a problem in this database. He is not checking if there usario and password.
    Attached Files Attached Files

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    The listbox start counting field from 0 not 1.

    So, change the Me.txtLogin.Column(1) to Me.txtLogin.Column(0).

    Hope this work for you.

  3. #3
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14
    Thank you, I'll do what you're saying.

  4. #4
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14
    Hello, I did what you said but still giving error. Says that the user does not exist. You can post the corrected code?

  5. #5
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14
    if you know of other code that do the same job you can have. thank you so much

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Why are same names and emails in both Login_Senha and Funcionario tables? This appears to be duplication of data. Should save only primary key as foreign key.

    The combobox RowSource has only one field. There is no need to use Column property.

    However, if you did make the combobox multi-column there would be no need for the DLookup expressions in the code because the values would be available by referencing the combobox Column property. Set up combobox properties:

    RowSource: SELECT Login_Senha.Identificação1, Login_Senha.[Nome do Usuário], Login_Senha.Login, Login_Senha.Senha FROM Login_Senha ORDER BY Login_Senha.Login;

    BoundColumn: 1
    ColumnCount: 4
    ColumnWidths: 0",1.5",1.0",1.0"
    LimitToList: Yes

    Then code:
    VerificaUsuario = Me.txtLogin.Column(2)
    SenhaDoUsuario = Me.textLogin.Column(3)

    Also, with properly joined tables as the combobox RowSouce the recordset would not be needed because the Identificacao field could be a column in the combobox.

    Name parts should really be in separate fields (FirstName, MiddleName, LastName).

    Should do searches on unique ID not names because people can have same names (maybe rare for you but not impossible).

    Tables have lookups - review: http://access.mvps.org/access/lookupfields.htm
    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.

  7. #7
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14
    I'm following what you're talking about but I can not: (can you post the code of the bank posted corrected?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Don't understand the question. What bank? I did not fix nor test code. Made suggestions for you to consider.

    You did not answer question. Address the issue table relationships before proceeding with code edits.
    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.

  9. #9
    rudenberg2013 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    14
    The database that is posted there with the wrong code you sent me another but it did not work. You can post the database with it right? I've tried several times. I do not speak english, I'm the translator, sorry.
    I made the relations before and I think there is interference.

  10. #10
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    There are 2 places referencing Me.txtLogin.Column(1) to Me.txtLogin.Column(0).

    You need to change them both.

    VerificaUsuario = DLookup("Login", "Login_Senha", "Login = '" & Me.txtLogin.Column(0) & "'") 'Especificar a Coluna do ListBox
    SenhaDoUsuario = DLookup("Senha", "Login_senha", "Login = '" & Me.txtLogin.Column(0) & "'") 'Especificar a Coluna do ListBox

    Hope this helps.

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

Similar Threads

  1. Logging History
    By Katiemay in forum Database Design
    Replies: 2
    Last Post: 08-09-2013, 03:07 PM
  2. Logging and tracking in access
    By snoopy in forum Programming
    Replies: 4
    Last Post: 11-01-2012, 09:01 PM
  3. Logging Changes
    By nichmeg in forum Programming
    Replies: 0
    Last Post: 12-06-2011, 02:47 PM
  4. Logging In
    By runtest in forum Programming
    Replies: 1
    Last Post: 02-21-2010, 11:55 PM
  5. Access Data Logging
    By pix in forum Access
    Replies: 0
    Last Post: 05-11-2009, 01:10 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