📄 选修课特殊情况处理.frm
字号:
VERSION 5.00
Begin VB.Form 选修课特殊情况处理
BorderStyle = 3 'Fixed Dialog
Caption = "学生特殊情况处理"
ClientHeight = 3165
ClientLeft = 2760
ClientTop = 2355
ClientWidth = 6390
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3165
ScaleWidth = 6390
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 3075
Left = 60
TabIndex = 0
Top = 0
Width = 6255
Begin VB.CommandButton Command3
Caption = "继续"
Height = 435
Left = 2460
TabIndex = 13
Top = 2520
Width = 1215
End
Begin VB.Frame Frame3
Height = 855
Left = 60
TabIndex = 10
Top = 1560
Width = 6135
Begin VB.TextBox Text1
Height = 300
Left = 2760
TabIndex = 11
Top = 300
Width = 1815
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入学号:"
Height = 180
Left = 1620
TabIndex = 12
Top = 360
Width = 1005
End
End
Begin VB.Frame Frame2
Height = 1455
Left = 90
TabIndex = 2
Top = 135
Width = 6135
Begin VB.TextBox Text3
Height = 315
Left = 1200
TabIndex = 9
Top = 780
Width = 1875
End
Begin VB.TextBox Text2
Height = 315
Left = 4140
TabIndex = 8
Top = 240
Width = 1875
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1200
TabIndex = 7
Top = 240
Width = 1875
End
Begin VB.CheckBox Check1
Caption = "不领书"
Height = 375
Left = 3660
TabIndex = 6
Top = 780
Width = 915
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "班级:"
Height = 180
Left = 600
TabIndex = 5
Top = 900
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 3600
TabIndex = 4
Top = 300
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "学号:"
Height = 180
Left = 600
TabIndex = 3
Top = 300
Width = 540
End
End
Begin VB.CommandButton Command1
Caption = "返回"
Height = 450
Left = 4140
TabIndex = 1
Top = 2520
Width = 1335
End
End
End
Attribute VB_Name = "选修课特殊情况处理"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Check1_Click()
If Check1.Value = 1 Then
选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "否"
Else
选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "是"
End If
End Sub
Private Sub Combo1_Click()
选修课教材出库.Adodc2.Recordset.MoveFirst
选修课教材出库.Adodc2.Recordset.Find "xh='" & Trim(Combo1.Text) & "'"
Text2.Text = 选修课教材出库.Adodc2.Recordset.Fields("xm")
Text3.Text = 选修课教材出库.Adodc2.Recordset.Fields("bj")
If 选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "是" Then
Check1.Value = 0
Else
Check1.Value = 1
End If
End Sub
Private Sub Command1_Click()
Dim adod As Integer
选修课教材出库.Adodc2.Recordset.MoveFirst
Do While Not 选修课教材出库.Adodc2.Recordset.EOF
If 选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "否" Then
js = js + 1
End If
选修课教材出库.Adodc2.Recordset.MoveNext
Loop
选修课教材出库.Adodc2.Recordset.MoveFirst
adod = 选修课教材出库.Adodc2.Recordset.RecordCount
选修课教材出库.Text2.Text = adod - js
选修课教材出库.Label2.Caption = "此班共有" + Str$(adod) + "人,其中有" + Str$(adod - js) + "人领书,有" + Str$(js) + "人不领书。"
'选修课教材出库.Command4.Enabled = False
Unload Me
End Sub
Private Sub Command3_Click()
Dim i%, cn%, bz%
If Text1.Text <> "" Then
cn = Combo1.ListCount
bz = 0
For i = 0 To cn
If Trim(Text1.Text) = Trim(Combo1.List(i)) Then bz = 1
Next
If bz = 0 Then
选修课教材出库.Adodc2.Recordset.MoveFirst
选修课教材出库.Adodc2.Recordset.Find "xh='" & Trim(Text1.Text) & "'"
If Not 选修课教材出库.Adodc2.Recordset.EOF Then
Combo1.AddItem Trim(Text1.Text)
Combo1.Text = Text1.Text
Text2.Text = 选修课教材出库.Adodc2.Recordset.Fields("xm")
Text3.Text = 选修课教材出库.Adodc2.Recordset.Fields("bj")
If 选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "是" Then
Check1.Value = 0
Else
Check1.Value = 1
End If
Else
MsgBox ("这个班无此人,请重新输入!"): Text1.Text = "": Text1.SetFocus
End If
Text1.Text = "": Text1.SetFocus
Else
MsgBox ("已有此人!"): Text1.Text = "": Text1.SetFocus
End If
Else
Text1.Text = "": Text1.SetFocus
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i%, cn%, bz%
If KeyCode = vbKeyReturn And Text1.Text <> "" Then
cn = Combo1.ListCount
bz = 0
For i = 0 To cn
If Trim(Text1.Text) = Trim(Combo1.List(i)) Then bz = 1
Next
If bz = 0 Then
选修课教材出库.Adodc2.Recordset.MoveFirst
选修课教材出库.Adodc2.Recordset.Find "xh='" & Trim(Text1.Text) & "'"
If Not 选修课教材出库.Adodc2.Recordset.EOF Then
Combo1.AddItem Trim(Text1.Text)
Combo1.Text = Text1.Text
Text2.Text = 选修课教材出库.Adodc2.Recordset.Fields("xm")
Text3.Text = 选修课教材出库.Adodc2.Recordset.Fields("bj")
If 选修课教材出库.Adodc2.Recordset.Fields("是否领书") = "是" Then
Check1.Value = 0
Else
Check1.Value = 1
End If
Text1.Text = "": Text1.SetFocus
Else
MsgBox ("这个班无此人,请重新输入!"): Text1.Text = "": Text1.SetFocus
End If
Else
MsgBox ("已有此人!"): Text1.Text = "": Text1.SetFocus
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -