Results 1 to 5 of 5

Correct password not being read in a userform

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Correct password not being read in a userform

    hi,

    i have created a login form which ask for the username and password. The user's name and passwords are stored in sheet named "Config"...specifically Users Name in Column A then passwords in Column B....Can you please provide correction to the code I have below?

    Private Sub btnlogin_Click()
    Dim iFoundPass As Integer
    On Error Resume Next
    With Sheets("Config").Range("Users")
    
       iFoundPass = .Find(What:=txtuser, after:=.Cells(1, 1), LookIn:=xlValues, LookAt _
            :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
            False).Row
    End With
    On Error GoTo 0
    
    If iFoundPass = 0 Then
       SomethingWrong
          Exit Sub
    End If
    
    If Sheets("Config").Cells(iFoundPass, 2) <> txtpwd Then
       
       SomethingWrong
        
          Exit Sub
          
    End If
        MsgBox "Validation Entry Correct", vbInformation + vbOKOnly, "Access Granted"
        Unload Me
        Application.Visible = True
          
    End Sub
    Regards,

    stoey
    Last edited by stoey; 10-14-2011 at 02:44 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1