Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Compare Database
- Option Explicit
- Private pHash As daily_status_v1.clsHash
- Private Sub Form_Load()
- ' Error: 91 - Object variable or With block variable not set
- Set pHash = New daily_status_v1.clsHash
- With Me
- .NavigationButtons = False
- .ScrollBars = 0
- .Moveable = True
- .ControlBox = False
- .RecordSelectors = False
- .RecordSource = "tblUser"
- With .cboUserName
- .RowSource = "" _
- & "SELECT " _
- & "u.Id, " _
- & "u.FirstName & ' ' & u.LastName " _
- & "FROM " _
- & "tblUser u " _
- & "ORDER BY " _
- & "u.FirstName & ' ' & u.LastName ASC"
- .ColumnCount = 2
- .ColumnWidths = "0;2"
- End With
- End With
- End Sub
- Private Sub btnLogin_Click()
- Dim UiPassword As String
- UiPassword = Me.txtPassword.Value
- If Not VBA.Information.IsNull(UiPassword) Then
- Dim DbPassword As String, _
- Criteria As String
- Criteria = "Id = " & Me.cboUserName.Value
- DbPassword = Application.DLookup("[Password]", "tblUser", Criteria)
- If pHash.Check(UiPassword, DbPassword) Then
- Application.DoCmd.Close acForm, Me.Name, acSaveYes
- Set pHash = Nothing
- End If
- End If
- End Sub
- Private Sub cboUserName_NotInList(NewData As String, Response As Integer)
- Response = acDataErrContinue
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement