Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 22nd, 2004, 01:53 PM
wjarrett's Avatar
wjarrett wjarrett is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Idaho
Posts: 70 wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 20 h 21 m 45 sec
Reputation Power: 19
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?

Reply With Quote
  #2  
Old August 23rd, 2004, 07:02 AM
bamboo bamboo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 168 bamboo User rank is Private First Class (20 - 50 Reputation Level)bamboo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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")%> & """

Reply With Quote
  #3  
Old August 24th, 2004, 03:46 PM
wjarrett's Avatar
wjarrett wjarrett is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Idaho
Posts: 70 wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 20 h 21 m 45 sec
Reputation Power: 19
Smile Whoooosh ! Right over my head !

Quote:
Originally Posted by bamboo
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")%> & """

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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > VB Newbie needs help with using dropdown combo box as record selector


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT