home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmChgPassword
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Change Password"
- ClientHeight = 1572
- ClientLeft = 4248
- ClientTop = 4584
- ClientWidth = 4032
- ClipControls = 0 'False
- Height = 1992
- Left = 4200
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1572
- ScaleWidth = 4032
- Top = 4212
- Width = 4128
- Begin CommandButton cmdCancel
- Caption = "Cancel"
- Height = 372
- Left = 2760
- TabIndex = 5
- Top = 960
- Width = 972
- End
- Begin CommandButton cmdOk
- Caption = "OK"
- Default = -1 'True
- Height = 372
- Left = 2760
- TabIndex = 4
- Top = 360
- Width = 972
- End
- Begin TextBox txtNewPwd
- Height = 300
- Left = 480
- PasswordChar = "*"
- TabIndex = 1
- Top = 960
- Width = 1550
- End
- Begin TextBox txtOldPwd
- Height = 300
- Left = 480
- PasswordChar = "*"
- TabIndex = 0
- Top = 360
- Width = 1550
- End
- Begin Label lblPwd
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Height = 192
- Left = 480
- TabIndex = 6
- Top = 1320
- Width = 60
- End
- Begin Label lblNPass
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "New Password: "
- Height = 192
- Left = 480
- TabIndex = 3
- Top = 720
- Width = 1332
- End
- Begin Label lblOPass
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "Old Password:"
- Height = 192
- Left = 480
- TabIndex = 2
- Top = 120
- Width = 1212
- End
- Option Explicit
- Dim Tries As Integer
- Sub cmdCancel_Click ()
- Unload Me
- End Sub
- Sub cmdOk_Click ()
- Dim Action As Integer
- Action = False'edit
- If txtOldPwd.Text = "" Then 'both required
- txtOldPwd.SetFocus
- Beep
- lblPwd.Caption = "Old Password is required."
- Exit Sub
- ElseIf txtNewPwd.Text = "" Then
- txtNewPwd.SetFocus
- Beep
- lblPwd.Caption = "New Password is required."
- Exit Sub
- End If
- Static Try1 As String, Try2 As String
- 'correct old password?
- If UCase$(txtOldPwd.Text) = PassWord Then
- txtNewPwd.SetFocus
- MsgBox "Incorrect password - please try again", 48, "Password"
- txtOldPwd.Text = ""
- txtOldPwd.SetFocus
- End If
- 'old passed
- Tries = Tries + 1
- If Tries = 1 Then
- Try1 = UCase$(txtNewPwd.Text)
- txtNewPwd.Text = ""
- Beep
- lblPwd.Caption = "Verify New password:"
- txtNewPwd.SetFocus
- Exit Sub
- Try2 = UCase$(txtNewPwd.Text)
- If Try1 <> Try2 Then
- MsgBox "Sorry - entries do not match", 48, "Password"
- Unload Me
- Exit Sub
- End If
- End If
- 'reaches here only if the two enties match.
- 'assign variables and concatinate the rest UserID is user's
- Try1 = Try1 & "|" & UserTaskLevel & "|" & Now & "|" & DateAdd("d", EXPIRE_TERM, Now)
- Call WritePasswd(Action, UserID, UserName, Try1)
- Tries = 0
- Unload Me
- End Sub
- Sub Form_Load ()
- Call FormCenterModal(Me)
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Set FrmChgPassword = Nothing
- End Sub
- Sub txtNewPwd_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then 'enter key
- SendKeys "{Tab}"
- KeyAscii = 0
- End If
- End Sub
- Sub txtOldPwd_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then 'enter key
- SendKeys "{Tab}"
- KeyAscii = 0
- End If
- End Sub
-