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

📄 frmmm.frm

📁 这是一套农村电费计算程序的源码。能够对用户电费进行计算、查询、打印。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmmm 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "密码设置"
   ClientHeight    =   1875
   ClientLeft      =   1695
   ClientTop       =   1635
   ClientWidth     =   4425
   Icon            =   "frmmm.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1875
   ScaleWidth      =   4425
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox Text3 
      Enabled         =   0   'False
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1920
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   960
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确 定"
      Height          =   375
      Left            =   1920
      TabIndex        =   0
      Top             =   1440
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Enabled         =   0   'False
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1920
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   480
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1920
      TabIndex        =   2
      ToolTipText     =   "用户名输入完后按(Enter)"
      Top             =   0
      Width           =   1575
   End
   Begin VB.Label Label3 
      Caption         =   "确认密码"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   840
      TabIndex        =   6
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "密    码"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   840
      TabIndex        =   5
      Top             =   600
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "用 户 名"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "frmmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
    Public sj As Database
    Public mmsj As Recordset
    Public ab As Integer

Private Sub Command1_Click()
    If ab = 6 Then
        If Text2.Text = Text3.Text Then
            mmsj.AddNew
            mmsj!User = Text1.Text
            mmsj!id = Text2.Text
            mmsj!mm = Text3.Text
            mmsj.Update
            Command1.Caption = "确 定"
            ab = 1
            'mmsj.Close
          Else
            MsgBox ("  密码不不正确,请重新输入 ")
            Text2.Text = ""
            Text3.Text = ""
            Text2.SetFocus
        End If
      Else
        sj.Close
        Unload Me

    End If
End Sub

Private Sub Form_Load()
    tmp = App.Path + "\data\cjsj.mdb"
    Set sj = OpenDatabase(tmp, False, False, ";pwd=sunlm")
End Sub

Private Sub Text1_Change()
    If Len(Trim(Text1.Text)) > 5 Then
        ab = MsgBox("用户名最多为5位", vbOKOnly, "提示!")
        Text1.Text = Mid(Text1.Text, 1, 5)
    End If
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        sqlm = "select * from mmk where user='" + Trim(Text1.Text) + "'"
        Set mmsj = sj.OpenRecordset(sqlm, dbOpenDynaset)
        If mmsj.RecordCount = 0 Then
            ab = MsgBox("  " + Text1.Text + " 使用者不存在是否增加?", vbYesNo, "提示:")
            If ab = 6 Then
                'If Text2.Text = "" Then
                '        ac = MsgBox("    请输入密码    ", vbOKOnly, "提示:")
                '        Text2.SetFocus
                '        Command1.Caption = "保 存"
                ' End If
                Text2.Enabled = True
                Text3.Enabled = True
                Text2.SetFocus
                Command1.Caption = "保 存"
                
            End If
         Else
            ac = MsgBox("    该用户已存在    ", vbOKOnly, "提示:")
            
        End If
    End If
End Sub

Private Sub Text1_LostFocus()
    If Text1.Text = "" Then
        Text1.SetFocus
    End If
End Sub

Private Sub Text2_Change()
    If Len(Trim(Text2.Text)) > 5 Then
        Text2.Text = Mid(Text2.Text, 1, 10)
    End If
End Sub

Private Sub Text3_Change()
    If Len(Trim(Text3.Text)) > 5 Then
        Text3.Text = Mid(Text3.Text, 1, 5)
    End If
End Sub

Private Sub Text2_LostFocus()
    If Text2.Text = "" Then
        ac = MsgBox("    请输入密码    ", vbOKOnly, "提示:")
        Text2.SetFocus
    End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyCode = 13 Then
        Text3.SetFocus
    End If
End Sub

Private Sub Text3_LostFocus()
    If Text2.Text = "" Then
        ac = MsgBox("    请输入密码    ", vbOKOnly, "提示:")
        Text2.SetFocus
    End If
End Sub

⌨️ 快捷键说明

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