⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmuser_modi.frm

📁 对家庭的开支有一个全面的了解和统计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmuser_modi 
   Caption         =   "修改用户密码"
   ClientHeight    =   3405
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3360
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   3405
   ScaleWidth      =   3360
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdcancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   1680
      TabIndex        =   6
      Top             =   2640
      Width           =   1215
   End
   Begin VB.CommandButton cmdok 
      Caption         =   "确认"
      Height          =   495
      Left            =   120
      TabIndex        =   5
      Top             =   2640
      Width           =   1215
   End
   Begin VB.TextBox txtnewpwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1440
      Width           =   1095
   End
   Begin VB.TextBox txtoldpwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   720
      Width           =   1095
   End
   Begin VB.TextBox txtusername 
      Height          =   375
      Left            =   1560
      TabIndex        =   1
      Top             =   120
      Width           =   1095
   End
   Begin VB.TextBox txttwopwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label Label4 
      Caption         =   "新密码密码:"
      Height          =   375
      Left            =   240
      TabIndex        =   9
      Top             =   1395
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "用户旧密码:"
      Height          =   375
      Left            =   240
      TabIndex        =   8
      Top             =   765
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "用户名:"
      Height          =   375
      Left            =   240
      TabIndex        =   7
      Top             =   120
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "确认新密码:"
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   2040
      Width           =   1095
   End
End
Attribute VB_Name = "frmuser_modi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim txtsql As String
Dim userdb As Database
Dim userrs As Recordset


 Sub entertotab(KeyAscii As Integer)
 If KeyAscii = 13 Then
    SendKeys "{TAB}"
 End If
End Sub


Private Sub cmdcancel_Click()
Unload Me
frmmain.Show
End Sub

Private Sub cmdok_Click()

Set userdb = OpenDatabase(App.Path & "\payout.mdb")
txtsql = "select * from user where user_name =  '" & txtusername.Text & "'"
Set userrs = userdb.OpenRecordset(txtsql)



If Trim(userrs.Fields(2)) <> Trim(txtoldpwd.Text) Then
   MsgBox "你输入的用户旧密码不对,请重新输入!", vbOKOnly + vbExclamation, "警告"
   txtoldpwd.Text = ""
   txtnewpwd.Text = ""
   txttwopwd.Text = ""
   txtoldpwd.SetFocus
ElseIf Trim(txtnewpwd.Text) <> Trim(txttwopwd.Text) Then
   MsgBox " 你两次输入的密码不一致,请重新输入!", vbOKOnly + vbExclamation, "警告"
   txtnewpwd.Text = ""
   txttwopwd.Text = ""
   txtnewpwd.SetFocus
Else
    userrs.Edit
    userrs.Fields(2) = Trim$(txtnewpwd.Text)
    userrs.Update
    userrs.Close
   MsgBox "密码修改成功!", vbOKOnly + vbInformation, "成功"
   cmdcancel.Caption = "退出"
   cmdcancel.SetFocus
   txtoldpwd.Text = ""
   txtnewpwd.Text = ""
   txttwopwd.Text = ""
End If
End Sub

Private Sub Form_Load()

txtusername.Text = username

End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Me
frmmain.Show
End Sub

Private Sub txtnewpwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys "{TAB}"
 End If
End Sub

Private Sub txtoldpwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys "{TAB}"
 End If
End Sub

Private Sub txttwopwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys "{TAB}"
 End If
End Sub

Private Sub txtusername_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys "{TAB}"
 End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -