Announcement

Collapse
No announcement yet.

Login, Username, Password, Program

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • roar34
    started a topic Login, Username, Password, Program

    Login, Username, Password, Program

    Hi,

    I'm just looking help for how to create a login form that when the right user enters their username and password it opens another userform. Currently I'm having difficulty starting but my username and passwords are all listed on one sheet, usernames are in column A and passwords in column B and the group they are part of in column E. Can anyone give me guidance as to how to start? I'm considered using a vlookup formula but am stuck on how to link it to the correct sheet etc. Thanks!

  • graha_karya
    replied
    you only make textbox1,cmb and combobox1
    Code:
    Public dic As Object
    Private Sub UserForm_Initialize()
      Dim x, i
      x = Sheet1.[a1].CurrentRegion.Value
      Set dic = CreateObject("Scripting.dictionary")
      For i = 2 To UBound(x)
        dic(x(i, 1)) = x(i, 2)
      Next i
      With ComboBox1
        .Clear
        .List = dic.keys
      End With
      CommandButton1.Enabled = False
    End Sub
    Private Sub CommandButton1_Click()
     UserForm1.Hide
     MsgBox "sucses to login ", vbCritical
    End Sub
    
    Private Sub TextBox1_Change()
    If ComboBox1.ListIndex = -1 Then Exit Sub
    If TextBox1.Value = dic(ComboBox1.Value) Then
      CommandButton1.Enabled = True
    End If
    End Sub

    Leave a comment:


  • roar34
    replied
    Hi,

    So attached is some data, this was provided by my teacher for practice, all the user ID and passwords are fake but I need to create a login that allows all the users from the file to log in and I'm finding it hard to create a code that can match the password with ID. I'm tried matching it so that the username pulls up a row number and match the row number to the password but it seems to not work. Any suggestions? Thanks!
    Attached Files

    Leave a comment:


  • Mumps
    replied
    Can you attach a copy of your file? Explain in detail exactly what you want to do.

    Leave a comment:

Working...
X