![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Username/Password Form
I have created a form with a combo box that contains the names of all users,
and a textbox for the password field. A couple years ago, I was shown a way to get rid of the combo box so that users would have to type in their username. i have attempted it over and over, but each time, it either will not work at all, or will find the record, but if the password is entered wrong, it wont be able to find it again. If anyone can help, I would really appreciate it. -- Todd |
|
|||
|
Re: Username/Password Form
hi Todd,
Todd C wrote: > I have created a form with a combo box that contains the names of all users, > and a textbox for the password field. A couple years ago, I was shown a way > to get rid of the combo box so that users would have to type in their > username. Something like this: Private Sub btn_Click() Dim rs As DAO.Recordset Dim SQL As String SQL = "SELECT * " & _ "FROM User " & _ "WHERE Username = " & SQLQuote(AUsername) & " " & _ "AND Password = " & SQLQuote(APassword) Set rs = CurrentDb.OpenRecordset(SQL, dbOpenSnapshot) If Not rs.Bof And Not rs.Eof Then ' valid credentials Else ' invalid credentials End If End Sub Public Function SQLQuote(AString As String, _ Optional ADelimiter As String = "'" _ ) As String SQLQuote = ADelimiter & _ Replace(AString, ADelimiter, ADelimiter & ADelimiter) & _ ADelimiter End Function mfG --> stefan <-- |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|