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

📄 form6.frm

📁 简单的银行管理系统代码,适合学生课程设计用
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Width           =   1215
      End
      Begin VB.Label label1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "用户编号"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Index           =   3
         Left            =   360
         TabIndex        =   5
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label label1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "性    别"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Index           =   4
         Left            =   3960
         TabIndex        =   4
         Top             =   840
         Width           =   1335
      End
      Begin VB.Label label1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "出生日期"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Index           =   5
         Left            =   360
         TabIndex        =   3
         Top             =   2400
         Width           =   1455
      End
   End
   Begin VB.Label Label5 
      Caption         =   "Label5"
      Height          =   495
      Left            =   3240
      TabIndex        =   23
      Top             =   2640
      Width           =   1215
   End
End
Attribute VB_Name = "添加用户"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
    Text8.Enabled = True
End Sub
Private Sub Command1_Click()
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
Set qrs = New ADODB.Recordset
  
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\银行管理系统.mdb;Persist Security Info=False"
    rs.Open "SELECT * FROM 用户基本信息 WHERE 用户编号='" & Trim(Text1.Text) & " '", con, adOpenStatic, adLockOptimistic
   
If rs.RecordCount > 0 Then

        MsgBox "以有这个用户编号!", vbOKOnly + vbExclamation, "警告"
   Else
    If Text8.Text = Text10.Text Then
   rs.AddNew
   rs.Fields(0) = Text1.Text
 rs.Fields(1) = Text2.Text
rs.Fields(2) = Combo1.Text
rs.Fields(3) = Text8.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = Text4.Text
rs.Fields(6) = Text9.Text
rs.Fields(7) = Text3.Text
rs.Fields("开户时间") = Date

                     rs.Update
                  MsgBox "添加成功!"
                  Text1.Text = ""
                  Text2.Text = ""
                  Combo1.Text = ""
                  Text4.Text = ""
                  Text3.Text = ""
                  Text5.Text = ""
                  Text8.Text = ""
                  Text9.Text = ""
                  Text10.Text = ""

         Else:
         MsgBox "两次输入密码不同!,请重新输入", vbOKOnly + vbExclamation, "警告"
            End If
        End If
        
End Sub

Private Sub Command2_Click()
Unload Me

End Sub



Private Sub Form_Load()

                  Text1.Text = ""
                  Text2.Text = ""
                  Text3.Text = ""
                  Combo1.Text = ""
                  Text4.Text = ""
                  Text5.Text = ""
                  Text8.Text = ""
                  Text9.Text = ""
                  Text10.Text = ""
                  
               
               
                
                

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
        If Text1.Text = "" Then
            MsgBox "请输入储户编号!", vbExclamation, "提示信息"
                 Text1.Text = ""
                 Text1.SetFocus
                    
                     ElseIf IsNumeric(Text1) = False Then
                       
                       MsgBox "请输入数字!", vbExclamation, "提示信息"
                       Text1.Text = ""
                       Text1.SetFocus
                           Else
                               Text2.Enabled = True
                               Text2.SetFocus
                      
           End If
                             
   End If
End Sub



Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
         If Text10.Text = "" Then
           If Len(Text10) <> 6 Then
                 MsgBox "请再次输入相同的密码!", vbExclamation, "提示信息"
                 Text10.Text = ""
                 Text10.SetFocus
             ElseIf IsNumeric(Text10) = False Then
                       
                       MsgBox "请输入数字!", vbExclamation, "提示信息"
         End If
        End If
    End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Len(Text2) > 8 Then
     
          MsgBox "字符超长,请重新输入!", vbExclamation, "提示信息"
          Text2.Text = ""
          Text2.SetFocus
       
              ElseIf Text2.Text = "" Then
                 MsgBox "请输入储户姓名!", vbExclamation, "提示信息"
                 Text2.Text = ""
                 Text2.SetFocus
                 Else
                      Combo1.Enabled = True
                     
     End If
End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
    If Len(Text3) < 18 Then
     
          MsgBox "身份证号非法,请重新输入!", vbExclamation, "提示信息"
          Text3.Text = ""
          Text3.SetFocus
        Else
                             Text4.Enabled = True
                             Text4.SetFocus
        End If

End If

        
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
     If Text4.Text = "" Then
         
                 MsgBox "请输入储户地址!", vbExclamation, "提示信息"
                 
                 Text4.Text = ""
                 Text4.SetFocus
                          Else
                             Text9.Enabled = True
                             Text9.SetFocus
                            
     End If
End If
End Sub


Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
         
            If Len(Text5) <> 8 Then
         MsgBox "请输入正确的出生日期!", vbExclamation, "提示信息"
                 
                 Text5.Text = ""
                 Text5.SetFocus
            Else
            Text3.Enabled = True
            Text3.SetFocus
        
         End If
    
       
    End If
 
End Sub


Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Len(Text8) <> 6 Then
     
          MsgBox "不符合规格,请重新输入密码!", vbExclamation, "提示信息"
          Text8.Text = ""
          Text8.SetFocus
       
              ElseIf Text8.Text = "" Then
                 MsgBox "请输入储户密码!", vbExclamation, "提示信息"
                 Text8.Text = ""
                 Text8.SetFocus
                 Else
                      Text5.Enabled = True
                     Text5.SetFocus
     End If
End If
End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
         If Text9.Text = "" Then
                 MsgBox "请输入联系电话!", vbExclamation, "提示信息"
                 Text9.Text = ""
                 Text9.SetFocus
            Else
                             Text10.Enabled = True
                             Text10.SetFocus
                        End If
                        
         End If
         
    

End Sub

⌨️ 快捷键说明

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