| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
VB Newbie needs help with using dropdown combo box as record selector
I am trying to set a password in a form with multiple users that will have different passwords. Their passwords will be stored in a table with their usernames. The table name will be called [tblUser] of course, and the only two fields are UserID and Password.
The method by which I want them to log in on my form is by selecting their UserID from a dropdown list combo box which displays all the UserID's in the table. Then I prompt them for a password with an Input box. What I am having trouble with is figuring out how to associate the password for the individual user. I have bought several books and can't seem to find what I am looking for. My sample code is displayed below. Private Sub Combo500_AfterUpdate() Dim pwd As String pwd = InputBox("Enter your password') If pwd = ??????????? Then ' This is the big mystery to me. ' How do I write this to ' compare it to the value in the ' table? MsgBox ("Password Accepted") Else MsgBox "Invalid Password" End If End Sub I have just started using Access and VBA and haven't done any programming since the days of GW-Basic (20 years ago) so this is all pretty new to me. Any suggestions? |
|
#2
|
|||
|
|||
|
Seems like you would want to compare the select UserId against your database. For example:
sql = "Select password, userid from tblUser where UserId = '" & <%=request.form("userId")%> & """ |
|
#3
|
||||
|
||||
|
Quote:
It seems I have a little more studying to do. I bought this book "Access Inside / out" but it's all Greek to me. I get most of the topics but this SQL, DAO stuff is kinda confusing. The book really doesn't cite very good examples of how the expressions and arguments are written. Thanks for a good example though maybe I can play with it and figure out what it all means now that I have a frame of reference to work from. |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > VB Newbie needs help with using dropdown combo box as record selector |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|