E
elli
Hi! (Again
)...
Thank U all for yesterday's help!
Today towards new challanges...
I created a form to ask username and password.
And even managed to make it to work..
Some little fixation still needed and this is where I need Your help. Now
when user puts wrong username there's a message-box saying: User not found
and so on (in finnish though) and the wrong username is cleared from the
textbox. Then the So far so good...
Then the application jumps to the password section, insted of staying in the
Kayttaja- textbox to let the user correct his/hers typing.... So what is the
piece of code that my code needs to stay there?
Thanks -elli the menace-
Private Sub Kayttaja_LostFocus()
Dim con As Object
Dim rs As Object
Dim s_sql As String
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
s_sql = "select * from Users where Kayttaja='" & Trim(Kayttaja) & "'"
rs.Open s_sql, con, 1
If rs.EOF = True Then
MsgBox "Käyttäjää ei löydy"
Me.Kayttaja = ""
Else
apupw = rs!Salasana
End If
End Sub

Thank U all for yesterday's help!
Today towards new challanges...
I created a form to ask username and password.
And even managed to make it to work..
Some little fixation still needed and this is where I need Your help. Now
when user puts wrong username there's a message-box saying: User not found
and so on (in finnish though) and the wrong username is cleared from the
textbox. Then the So far so good...
Then the application jumps to the password section, insted of staying in the
Kayttaja- textbox to let the user correct his/hers typing.... So what is the
piece of code that my code needs to stay there?
Thanks -elli the menace-
Private Sub Kayttaja_LostFocus()
Dim con As Object
Dim rs As Object
Dim s_sql As String
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
s_sql = "select * from Users where Kayttaja='" & Trim(Kayttaja) & "'"
rs.Open s_sql, con, 1
If rs.EOF = True Then
MsgBox "Käyttäjää ei löydy"
Me.Kayttaja = ""
Else
apupw = rs!Salasana
End If
End Sub