?? 選修課特殊情況處理.frm
字號:
VERSION 5.00
Begin VB.Form 選修課特殊情況處理
BorderStyle = 3 'Fixed Dialog
Caption = "學(xué)生特殊情況處理"
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 = "繼續(xù)"
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 = "請輸入學(xué)號:"
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 = "不領(lǐng)書"
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 = "學(xué)號:"
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("是否領(lǐng)書") = "否"
Else
選修課教材出庫.Adodc2.Recordset.Fields("是否領(lǐng)書") = "是"
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("是否領(lǐng)書") = "是" 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("是否領(lǐng)書") = "否" 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) + "人領(lǐng)書,有" + Str$(js) + "人不領(lǐng)書。"
'選修課教材出庫.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("是否領(lǐng)書") = "是" 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("是否領(lǐng)書") = "是" 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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -