Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
username and password
Old 09-05-2006, 10:02 AM username and password
lushh's Avatar
Novice Talker

Posts: 10
Name: Eunice
Trades: 0
hi.. i am working on a system and it needs a username and password for security. i am using ms access 2003. and my form looks like this:



the user will enter a username and password in order to get into the system. the system will have 2 or more users. i just wanna ask if anyone has a sample VBA code for this kind of form. your replies wil surely be appreciated. thank you very much.
lushh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-06-2006, 08:32 AM Re: username and password
Rufo's Avatar
Extreme Talker

Posts: 173
Trades: 0
The easiest (but not best!) way to do this would be using a case/if combo:
Code:
Private Sub cmdLogin_Click()

  un = txtUsername.Text
  pw = txtPassword.Text

  ok = False

  Select Case un
    Case "user1"
      If pw = "pw1" Then ok = True
    Case "user2"
      If pw = "pw2" Then ok = True
    Case "user3"
      If pw = "pw3" Then ok = True
  End Select

  If ok Then
    'login was ok - do something
  Else
    'login was not ok - do something else
  End If

End Sub
Rufo
__________________

Please login or register to view this content. Registration is FREE
Rufo is offline
Reply With Quote
View Public Profile Visit Rufo's homepage!
 
Old 09-06-2006, 09:48 PM Re: username and password
lushh's Avatar
Novice Talker

Posts: 10
Name: Eunice
Trades: 0
thanks for the reply. it really did help.. =)
lushh is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to username and password
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.17889 seconds with 12 queries