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

📄 frmaddclassinfo.frm

📁 这是个学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAddclassinfo 
   Caption         =   "添加班级信息"
   ClientHeight    =   2610
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   5685
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   2610
   ScaleWidth      =   5685
   Begin VB.ComboBox comboGrade 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   312
      Left            =   3720
      TabIndex        =   9
      Top             =   480
      Width           =   1692
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   2760
      TabIndex        =   8
      Top             =   1920
      Width           =   1092
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   960
      TabIndex        =   7
      Top             =   1920
      Width           =   1092
   End
   Begin VB.TextBox txtClassroom 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   3720
      TabIndex        =   6
      Top             =   1200
      Width           =   1692
   End
   Begin VB.TextBox txtDirector 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   1200
      TabIndex        =   4
      Top             =   1200
      Width           =   1332
   End
   Begin VB.TextBox txtClassno 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   1200
      TabIndex        =   1
      Top             =   480
      Width           =   1332
   End
   Begin VB.Label Label4 
      Caption         =   "教室:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   2880
      TabIndex        =   5
      Top             =   1200
      Width           =   732
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      Caption         =   "班主任:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   3
      Top             =   1200
      Width           =   972
   End
   Begin VB.Label Label2 
      Caption         =   "年级:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   2880
      TabIndex        =   2
      Top             =   480
      Width           =   732
   End
   Begin VB.Label Label1 
      Caption         =   "班号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   732
   End
End
Attribute VB_Name = "frmAddclassinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public OK As Boolean


Private Sub Command1_Click()
    
    Dim combo As Boolean
   
   ' Dim mrc As ADODB.Recordset
   ' Dim MsgText As String
   ' Dim txtSQL As String
    
    If Not Testtxt(txtClassno.text) Then
        MsgBox "请输入班号!", vbOKOnly + vbExclamation, "警告"
        txtClassno.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(comboGrade.text) Then
        MsgBox "请选择年级!", vbOKOnly + vbExclamation, "警告"
        comboGrade.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(txtDirector.text) Then
        MsgBox "请输入班主任姓名!", vbOKOnly + vbExclamation, "警告"
        txtDirector.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(txtClassroom.text) Then
        MsgBox "请输入教室房间号!", vbOKOnly + vbExclamation, "警告"
        txtClassroom.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(Trim(txtClassno.text)) Then
        MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
        txtClassno.SetFocus
    End If
    combo = InCombo(comboGrade.text, comboGrade)
     If combo = False Then
     Exit Sub
     End If
     
     
    
    
    With MyEmp
    .class_No = Trim(txtClassno)
    .grade = Trim(comboGrade.text)
    .director = Trim(txtDirector)
    .classroom_No = Trim(txtClassroom)
    
    If Modify = False Then
    .Insert
  Else
    Call .Update(CurEmp.class_No)
  End If
  End With
  OK = True
    
  
    MsgBox "添加班级信息成功!", vbOKOnly + vbExclamation, "添加班级信息"
    
    
        
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub form_load()
    comboGrade.AddItem "计科系99级"
    comboGrade.AddItem "计科系00级"
    comboGrade.AddItem "计科系01级"
    comboGrade.AddItem "计科系02级"
    comboGrade.AddItem "计科系03级"
   
End Sub

⌨️ 快捷键说明

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