Private Sub CheckUsers()

    Dim sUserName As String
    sUserName = "KarenSt"
    Dim sPassword As String
    sPassword = "Password1"
    If Authenticate(sUserName, sPassword) Then
        MsgBox "Success", vbOKOnly, "Test"
        MsgBox "Fail", vbOKOnly, "Test"
    End If

End Sub

Private Function Authenticate(sUserName As String, sPassword As String) As Boolean

    Authenticate = False

    Dim oStu As cSBStudent
    Set oStu = New cSBStudent
    oStu.Init FE_Application.SessionContext
    oStu.Load 1
    Debug.Print "UserName: " & sUserName & " - " & oStu.Fields(SBSTUDENTS_fld_ONLINEUSERID)
    Debug.Print "Password: " & sPassword & " - " & oStu.Fields(SBSTUDENTS_fld_ONLINEPASSWORD)
    If oStu.Fields(SBSTUDENTS_fld_ONLINEUSERID) = sUserName Then
        If oStu.Fields(SBSTUDENTS_fld_ONLINEPASSWORD) = sPassword Then
            Authenticate = True
            Debug.Print "Password does not match."
        End If
        Debug.Print "User Name does not match."
    End If
    Set oStu = Nothing

End Function

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.