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

📄 form15.frm

📁 人事管理系统 基本功能说明: 3.1数据录入 提供两种信息录入方式:列表录入、模板录入,用以满足不同用户的需要。 3.2数据的删除修改: 对数据的最基本的操作,保证数据正确性和完整性,为
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form15 
   Caption         =   "Form15"
   ClientHeight    =   7065
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10125
   LinkTopic       =   "Form15"
   ScaleHeight     =   6359.759
   ScaleMode       =   0  'User
   ScaleWidth      =   10662.05
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command8 
      Caption         =   "退  出"
      Height          =   495
      Left            =   8280
      TabIndex        =   19
      Top             =   6480
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   1560
      Top             =   6840
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=RSGL.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=RSGL.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame3 
      Caption         =   "数据显示"
      Height          =   4455
      Left            =   3720
      TabIndex        =   11
      Top             =   1800
      Width           =   6135
      Begin MSDataGridLib.DataGrid DataGrid1 
         Height          =   3975
         Left            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   5895
         _ExtentX        =   10398
         _ExtentY        =   7011
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "记录操作"
      Height          =   5295
      Left            =   240
      TabIndex        =   6
      Top             =   1440
      Width           =   3375
      Begin VB.CommandButton Command7 
         Caption         =   "修改记录"
         Height          =   495
         Left            =   1800
         TabIndex        =   18
         Top             =   4320
         Width           =   1215
      End
      Begin VB.CommandButton Command6 
         Caption         =   "删除记录"
         Height          =   495
         Left            =   240
         TabIndex        =   17
         Top             =   4320
         Width           =   1095
      End
      Begin VB.CommandButton Command5 
         Caption         =   "浏览记录"
         Height          =   495
         Left            =   1920
         TabIndex        =   15
         Top             =   2880
         Width           =   1215
      End
      Begin VB.CommandButton Command4 
         Caption         =   "确  定"
         Height          =   495
         Left            =   1920
         TabIndex        =   14
         Top             =   1680
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Caption         =   "选中表后先按本按钮,再做下边操作"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   360
         TabIndex        =   13
         Top             =   360
         Width           =   2535
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   8
         Top             =   3000
         Width           =   1455
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   1800
         Width           =   1335
      End
      Begin VB.Label Label5 
         Caption         =   "先按下浏览记录按钮,再进行删除或修改操作"
         BeginProperty Font 
            Name            =   "幼圆"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   495
         Left            =   120
         TabIndex        =   16
         Top             =   3600
         Width           =   2175
      End
      Begin VB.Label Label4 
         Caption         =   "选择要操作的记录"
         BeginProperty Font 
            Name            =   "幼圆"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   375
         Left            =   240
         TabIndex        =   10
         Top             =   2400
         Width           =   1815
      End
      Begin VB.Label Label3 
         Caption         =   "选择要操作的字段,然后按确定键"
         BeginProperty Font 
            Name            =   "幼圆"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   495
         Left            =   240
         TabIndex        =   9
         Top             =   1080
         Width           =   1935
      End
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   2520
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   840
      Width           =   1935
   End
   Begin VB.Frame Frame1 
      Caption         =   "表操作"
      Height          =   1335
      Left            =   5280
      TabIndex        =   1
      Top             =   360
      Width           =   3855
      Begin VB.CommandButton Command2 
         Caption         =   "添加记录"
         Height          =   615
         Left            =   2280
         TabIndex        =   5
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Command1 
         Caption         =   "浏览表"
         Height          =   615
         Left            =   480
         TabIndex        =   4
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Label Label2 
      Caption         =   "选择要操作的表"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   240
      TabIndex        =   2
      Top             =   840
      Width           =   1815
   End
   Begin VB.Label Label1 
      Caption         =   "请先选择要操作的表,再进行操作"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   4575
   End
End
Attribute VB_Name = "Form15"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Adodc1.RecordSource = "select * from " & Combo1.Text & ""
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
        DataGrid1.Refresh
        DataGrid1.AllowAddNew = False
        DataGrid1.AllowDelete = False
        DataGrid1.AllowUpdate = False
        '表里的记录不允许添加、删除、修改
End Sub

Private Sub Command2_Click()
    Adodc1.RecordSource = "select * from " & Combo1.Text & ""
    Adodc1.Refresh
    If Combo1.Text = "人事基本信息表" Then
        
    Else: Set DataGrid1.DataSource = Adodc1
                DataGrid1.Refresh
                DataGrid1.AllowAddNew = True
                DataGrid1.AllowDelete = False
                DataGrid1.AllowUpdate = True
    End If
              
End Sub

Private Sub Command3_Click()
    Adodc1.RecordSource = "select * from " & Combo1.Text & ""
    Adodc1.Refresh

        a = Combo2.ListCount
        If a <> 0 Then
            For i = 0 To a - 1
            Combo2.RemoveItem 0
            Next i
        End If
        
        For Each i In Adodc1.Recordset.Fields
            Combo2.AddItem i.Name
            Next i
            '把表中的字段名称列在combo2里

End Sub

Private Sub Command4_Click()
    Dim zd As String
    zd = Combo2.Text
    Adodc1.RecordSource = "select " & zd & "  from " & Combo1.Text & ""
    Adodc1.Refresh
    a = Combo3.ListCount
        If a <> 0 Then
            For i = 0 To a - 1
            Combo3.RemoveItem 0
            Next i
        End If
    While Not Adodc1.Recordset.EOF
    Combo3.AddItem Adodc1.Recordset.Fields(zd)
    Adodc1.Recordset.MoveNext
    Wend
    '把记录列在combo3里
End Sub

Private Sub Command5_Click()
    Adodc1.RecordSource = "select * from " & Combo1.Text & " where " & Combo2.Text & " = '" & Combo3.Text & "'"
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
        DataGrid1.Refresh
        DataGrid1.AllowAddNew = False
        DataGrid1.AllowDelete = False
        DataGrid1.AllowUpdate = False
End Sub

Private Sub Command6_Click()
    a = MsgBox("确实要删除此条纪录吗?", 1, "a")
    If a = 1 Then
        Adodc1.RecordSource = "select *from " & Combo1.Text & " where " & Combo2.Text & " = '" & Combo3.Text & "'"
        Adodc1.Refresh
        DataGrid1.AllowAddNew = False
        DataGrid1.AllowDelete = True
        DataGrid1.AllowUpdate = True
        Adodc1.Recordset.Delete
    End If
    
End Sub

Private Sub Command7_Click()
    If Combo1.Text = "人事基本信息表" Then
    a = MsgBox("人事基本信息表不允许修改记录!", , "注意!")
    Else
    DataGrid1.AllowAddNew = False
    DataGrid1.AllowDelete = False
    DataGrid1.AllowUpdate = True
    End If
End Sub

Private Sub Command8_Click()
Unload Me
End Sub

Private Sub Form_Load()

    Form15.Left = 700
    Form15.Top = 700
     
    Combo1.AddItem "人事基本信息表"
    Combo1.AddItem "部门表"
    Combo1.AddItem "科室表"
    Combo1.AddItem "教学记录表"
    '把需要的表名添加到combo1这个列表框里
 
End Sub

⌨️ 快捷键说明

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