I have a problem in this database. He is not checking if there usario and password.
I have a problem in this database. He is not checking if there usario and password.
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.
Thank you, I'll do what you're saying.
Hello, I did what you said but still giving error. Says that the user does not exist. You can post the corrected code?
if you know of other code that do the same job you can have. thank you so much
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.
I'm following what you're talking about but I can not: (can you post the code of the bank posted corrected?
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.
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.
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.