📄 添加班级信息.frm
字号:
VERSION 5.00
Begin VB.Form Form5
Caption = "添加班级信息"
ClientHeight = 5880
ClientLeft = 60
ClientTop = 450
ClientWidth = 8280
LinkTopic = "Form5"
MDIChild = -1 'True
ScaleHeight = 5880
ScaleWidth = 8280
WindowState = 2 'Maximized
Begin VB.ComboBox cbograde
Height = 300
Left = 3360
TabIndex = 6
Top = 600
Width = 1815
End
Begin VB.TextBox txtroom
Height = 495
Left = 3360
TabIndex = 5
Top = 3000
Width = 1815
End
Begin VB.TextBox txtdirector
Height = 495
Left = 3360
TabIndex = 4
Top = 2160
Width = 1815
End
Begin VB.TextBox txtclass
Height = 495
Left = 3360
TabIndex = 3
Top = 1320
Width = 1815
End
Begin VB.CommandButton cmdclear
BackColor = &H00C0C0C0&
Caption = "清 空"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5880
Style = 1 'Graphical
TabIndex = 2
Top = 4800
Width = 1335
End
Begin VB.CommandButton cmdexit
BackColor = &H00C0C0C0&
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3600
Style = 1 'Graphical
TabIndex = 1
Top = 4800
Width = 1335
End
Begin VB.CommandButton cmdok
BackColor = &H00C0C0C0&
Caption = "确 认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
Picture = "添加班级信息.frx":0000
Style = 1 'Graphical
TabIndex = 0
Top = 4800
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "班主任"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1440
TabIndex = 10
Top = 2160
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "班级"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1440
TabIndex = 9
Top = 1440
Width = 735
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "教室"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1440
TabIndex = 8
Top = 3000
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "年级"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1440
TabIndex = 7
Top = 600
Width = 735
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdclean_Click()
txtclass.Text = ""
txtgrade.Text = ""
txtdirector.Text = ""
txtclassroom.Text = ""
End Sub
Private Sub cmdexit_Click()
Me.Hide
End Sub
Private Sub cmdclear_Click()
txtclass.Text = ""
cbograde.Text = ""
txtdirector.Text = ""
txtroom.Text = ""
End Sub
Private Sub cmdOK_Click()
Dim txtsql As String
Dim mrc As Adodb.Recordset
Dim msgtext As String
If Trim(txtclass.Text) = "" Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "请输入班级!"
txtclass.SetFocus
Exit Sub
Else
txtsql = "select * from class_info"
Set mrc = executesql(txtsql, msgtext)
While (mrc.EOF = False)
If Trim(mrc.Fields(0) = Trim(txtclass.Text)) Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "该班级已存在,请重输!"
txtclass.SetFocus
txtclass.Text = ""
txtdirector.Text = ""
cbograde.Text = ""
txtroom.Text = ""
Exit Sub
Else
mrc.MoveNext
End If
Wend
End If
If Trim(cbograde.Text) = "" Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "请选择年级!"
cbograde.SetFocus
End If
mrc.AddNew
mrc.Fields(0) = Trim(txtclass.Text)
mrc.Fields(1) = Trim(cbograde.Text)
mrc.Fields(2) = Trim(txtdirector.Text)
mrc.Fields(3) = Trim(txtroom.Text)
mrc.Update
mrc.Close
FrmMain.StatusBarmy.Panels.Item(1).Text = "班级添加成功!"
End Sub
Private Sub Form_Load()
txtclass.Text = ""
cbograde.AddItem ""
cbograde.AddItem "大一"
cbograde.AddItem "大二"
cbograde.AddItem "大三"
cbograde.AddItem "大四"
txtdirector.Text = ""
txtroom.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -