📄 form6.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Form6
Caption = "统计班级人数"
ClientHeight = 1965
ClientLeft = 60
ClientTop = 345
ClientWidth = 5010
LinkTopic = "Form6"
Picture = "Form6.frx":0000
ScaleHeight = 1965
ScaleWidth = 5010
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
BackColor = &H8000000E&
Height = 495
Left = 2880
MaskColor = &H00FFFFFF&
Picture = "Form6.frx":2BEE2
Style = 1 'Graphical
TabIndex = 3
Top = 1200
Width = 1095
End
Begin VB.CommandButton Command1
BackColor = &H8000000E&
Height = 495
Left = 480
MaskColor = &H00FFFFFF&
Picture = "Form6.frx":2ED6F
Style = 1 'Graphical
TabIndex = 2
Top = 1200
Width = 1095
End
Begin MSDataListLib.DataCombo DataCombo1
Height = 330
Left = 2280
TabIndex = 1
Top = 360
Width = 2055
_ExtentX = 3625
_ExtentY = 582
_Version = 393216
Text = ""
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H8000000E&
BackStyle = 0 'Transparent
Caption = "请选择或输入班级:"
Height = 180
Left = 480
TabIndex = 0
Top = 480
Width = 1620
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim total As Integer, strsql As String
strsql = "select count(*) from 学生基本信息 where 班级 like '" & Trim(DataCombo1.Text) & "%'"
If myrs.State = adStateOpen Then
myrs.Close
End If
Set myrs = mycon.Execute(strsql)
myrs.MoveFirst
total = myrs.Fields(0)
MsgBox Trim(DataCombo1.Text) & "班的总人数为:" & Str(total), , "统计结果"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -