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

📄 tea_edit.frm

📁 这是一个非常 好的一个程序进行体会一下学生管理系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      ItemData        =   "Tea_edit.frx":018E
      Left            =   3840
      List            =   "Tea_edit.frx":0190
      TabIndex        =   9
      Top             =   1680
      Width           =   1575
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Index           =   1
      ItemData        =   "Tea_edit.frx":0192
      Left            =   1320
      List            =   "Tea_edit.frx":0194
      TabIndex        =   7
      Top             =   1680
      Width           =   1215
   End
   Begin VB.ComboBox Combo1 
      BeginProperty DataFormat 
         Type            =   5
         Format          =   ""
         HaveTrueFalseNull=   1
         TrueValue       =   "男"
         FalseValue      =   "女"
         NullValue       =   ""
         FirstDayOfWeek  =   0
         FirstWeekOfYear =   0
         LCID            =   2052
         SubFormatType   =   7
      EndProperty
      Height          =   300
      Index           =   0
      ItemData        =   "Tea_edit.frx":0196
      Left            =   7080
      List            =   "Tea_edit.frx":01A0
      TabIndex        =   5
      Top             =   240
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   300
      Index           =   1
      Left            =   3840
      TabIndex        =   3
      Top             =   240
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      Height          =   300
      Index           =   0
      Left            =   1320
      MaxLength       =   8
      TabIndex        =   1
      Top             =   240
      Width           =   1215
   End
   Begin VB.Label Label34 
      BackColor       =   &H00FFC0C0&
      Caption         =   "所学专业:"
      Height          =   255
      Left            =   6120
      TabIndex        =   63
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label33 
      BackColor       =   &H00FFC0C0&
      Caption         =   "入党时间:"
      Height          =   255
      Left            =   3000
      TabIndex        =   60
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label32 
      BackColor       =   &H00FFC0C0&
      Caption         =   "家庭成分:"
      Height          =   255
      Left            =   360
      TabIndex        =   59
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label31 
      BackColor       =   &H00FFC0C0&
      Caption         =   "政治面貌:"
      Height          =   255
      Left            =   3000
      TabIndex        =   58
      Top             =   720
      Width           =   975
   End
   Begin VB.Label Label30 
      BackColor       =   &H00FFC0C0&
      Caption         =   "民  族:"
      Height          =   255
      Left            =   360
      TabIndex        =   57
      Top             =   720
      Width           =   735
   End
   Begin VB.Label Label29 
      BackColor       =   &H00FFC0C0&
      Caption         =   "籍  贯:"
      Height          =   255
      Left            =   6240
      TabIndex        =   53
      Top             =   720
      Width           =   735
   End
   Begin VB.Label Label28 
      BackColor       =   &H00FFC0C0&
      Caption         =   "手  机:"
      Height          =   255
      Left            =   3000
      TabIndex        =   51
      Top             =   3600
      Width           =   855
   End
   Begin VB.Label Label27 
      BackColor       =   &H00FFC0C0&
      Caption         =   "办公电话:"
      Height          =   255
      Left            =   360
      TabIndex        =   49
      Top             =   3600
      Width           =   1215
   End
   Begin VB.Label Label26 
      BackColor       =   &H00FFC0C0&
      Caption         =   "家庭电话:"
      Height          =   255
      Left            =   6120
      TabIndex        =   47
      Top             =   3120
      Width           =   975
   End
   Begin VB.Label Label25 
      BackColor       =   &H00FFC0C0&
      Caption         =   "家庭地址:"
      Height          =   255
      Left            =   360
      TabIndex        =   45
      Top             =   3120
      Width           =   975
   End
   Begin VB.Label Label24 
      BackColor       =   &H00FFC0C0&
      Caption         =   "毕业时间:"
      Height          =   255
      Left            =   6120
      TabIndex        =   43
      Top             =   2640
      Width           =   975
   End
   Begin VB.Label Label23 
      BackColor       =   &H00FFC0C0&
      Caption         =   "毕业学校:"
      Height          =   255
      Left            =   2880
      TabIndex        =   41
      Top             =   2640
      Width           =   975
   End
   Begin VB.Label Label14 
      BackColor       =   &H00FFC0C0&
      Caption         =   "备注信息(不得多于100字)"
      Height          =   255
      Left            =   360
      TabIndex        =   25
      Top             =   4080
      Width           =   2535
   End
   Begin VB.Label Label13 
      BackColor       =   &H00FFC0C0&
      Caption         =   "所带班级:"
      Height          =   255
      Left            =   6120
      TabIndex        =   23
      Top             =   4080
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.Label Label12 
      BackColor       =   &H00FFC0C0&
      Caption         =   "是否为班导师:"
      Height          =   255
      Left            =   6120
      TabIndex        =   21
      Top             =   3600
      Width           =   1695
   End
   Begin VB.Label Label11 
      BackColor       =   &H00FFC0C0&
      Caption         =   "级"
      Height          =   255
      Left            =   2160
      TabIndex        =   20
      Top             =   2640
      Width           =   255
   End
   Begin VB.Label Label10 
      BackColor       =   &H00FFC0C0&
      Caption         =   "岗位级别:"
      Height          =   255
      Left            =   360
      TabIndex        =   18
      Top             =   2640
      Width           =   975
   End
   Begin VB.Label Label9 
      BackColor       =   &H00FFC0C0&
      Caption         =   "参加工作日期:"
      Height          =   255
      Left            =   5760
      TabIndex        =   16
      Top             =   1680
      Width           =   1335
   End
   Begin VB.Label Label8 
      BackColor       =   &H00FFC0C0&
      Caption         =   "职  务:"
      Height          =   255
      Left            =   3000
      TabIndex        =   14
      Top             =   2160
      Width           =   735
   End
   Begin VB.Label Label7 
      BackColor       =   &H00FFC0C0&
      Caption         =   "所属系部:"
      Height          =   255
      Left            =   360
      TabIndex        =   12
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label6 
      BackColor       =   &H00FFC0C0&
      Caption         =   "出生年月:"
      Height          =   255
      Left            =   6120
      TabIndex        =   10
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label5 
      BackColor       =   &H00FFC0C0&
      Caption         =   "职  称:"
      Height          =   255
      Left            =   3000
      TabIndex        =   8
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label4 
      BackColor       =   &H00FFC0C0&
      Caption         =   "学  历:"
      Height          =   255
      Left            =   360
      TabIndex        =   6
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label3 
      BackColor       =   &H00FFC0C0&
      Caption         =   "性  别:"
      Height          =   255
      Left            =   6240
      TabIndex        =   4
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFC0C0&
      Caption         =   "姓  名:"
      Height          =   255
      Left            =   3000
      TabIndex        =   2
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "职工号:"
      Height          =   255
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   735
   End
End
Attribute VB_Name = "Form14"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "RVB_UniqueId" ,"41FF01F50117"
Attribute VB_Ext_KEY = "RVB_ModelStereotype" ,"Form"
Public actiontype As Integer '定义类型变量,区分动作种类
Dim txtSQL As String
Private txtSQL1 As String   'ExecuteSQL 的 SQL语句参数
Dim mrc As ADODB.Recordset
Private mrc1 As ADODB.Recordset  '定义查询返回记录集
Dim inno As String '用来记录输入的学号
Dim i As Integer   '定义循环变量

Private Sub Combo1_Click(Index As Integer)
    If Index = 6 Then
        Select Case Combo1(6).ListIndex
            Case 0:
                Label13.Visible = False
                Text1(4).Visible = False
            Case 1:
                Label13.Visible = True
                Text1(4).Visible = True
        End Select
    End If
End Sub

Private Sub Command1_Click() '添加按钮
    actiontype = 1 '置类型变量为1,表明是执行添加操作
    mrc.AddNew
    Label13.Visible = True
    Text1(4).Visible = True
    Text1(0).Locked = False
    Command1.Enabled = False '添加无效
    Command2.Enabled = False '修改无效
    Command3.Enabled = False '删除无效
    Command4.Enabled = True '保存有效
    Command5.Enabled = True '取消有效
    Call Blank_all
    Text1(0).SetFocus
End Sub

Private Sub Command2_Click() '修改按钮
    inno = InputBox("请输入你要修改的教职工号(8位):", "注意") '输入要想修改的教职工号
    If inno <> "" Then
        txtSQL1 = "select Tea_id from Tea_info where Tea_id=" & "'" & Trim(inno) & "'" '查询该职工号对应的记录是否存在
        Set mrc1 = cnn1.Execute(txtSQL1)    '执行查询,并将结果返回给mrc1
        If mrc1.EOF Then                   '根据mrc1.EOF标志判断是否存在该记录
          MsgBox "该职工号不存在!", 0 + 48, "注意"
          Command2.SetFocus                '要求重新输入职工号
          mrc1.Close                       '关闭记录集
          Exit Sub
        Else
          mrc1.Close
          Command1.Enabled = False '添加无效
          Command2.Enabled = False '修改无效
          Command3.Enabled = False '删除无效
          Command4.Enabled = True '保存有效
          Command5.Enabled = True '取消有效
          mrc.MoveFirst     '将所查到的记录置为控件的当前记录
          Do While mrc.Fields(0) <> inno
                mrc.MoveNext
          Loop
          Call Blank_all
          Call Show_record
        End If
     End If
End Sub

Private Sub Command3_Click() '删除按钮
    inno = InputBox("请输入你要删除的教职工号(8位):", "注意") '输入需要删除的教师的职工号
    If inno <> "" Then  '在输入非空的情况下,进行查询
        txtSQL1 = "select Tea_id from Tea_info where Tea_id=" & "'" & Trim(inno) & "'"
        Set mrc1 = ExecuteSQL(txtSQL1, MsgText)
        If mrc1.EOF Then    '如果输入的职工号不存在,给出提示
            MsgBox "该职工号不存在!", 0 + 48, "注意"
            Command3.SetFocus
            mrc1.Close
            Exit Sub
        End If
            mrc1.Close
            mrc.MoveFirst
            Do While mrc.Fields(0) <> inno  '置需要删除的记录为当前记录
                mrc.MoveNext
            Loop
            Call Show_record
            Dim re As Integer
            re = MsgBox("真的要删除该记录吗?", 4 + 32 + 256, "询问!")
            If re = 6 Then
                mrc.Delete '如果返回“是”,删除记录
                mrc.Requery
                If mrc.EOF Then '删除的是最后一个记录的情况
                    MsgBox "数据库内已无教师信息记录!", 0 + 48, "注意!"
                    Call Blank_all
                    Text1(0).Locked = True '在无记录的情况下,必须添加
                    Command3.Enabled = False
                    Command2.Enabled = False
                    Command1.SetFocus
                    Exit Sub
                Else:
                    mrc.MoveFirst '置第一个记录为当前记录
                    Call Show_record
                End If
            End If
    End If

⌨️ 快捷键说明

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