frmcj1.frm
来自「源码+论文 vB+access的毕业设计,请大家参考」· FRM 代码 · 共 1,401 行 · 第 1/3 页
FRM
1,401 行
End
Begin CSCommand.Command Command8
Height = 375
Left = 6600
TabIndex = 62
Top = 720
Width = 1095
_ExtentX = 1931
_ExtentY = 661
IconAlign = 0
Icon = "frmcj1.frx":008C
Caption = "取 消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试分数"
Height = 255
Index = 5
Left = 6600
TabIndex = 17
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试课程"
Height = 255
Index = 4
Left = 4920
TabIndex = 16
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学生编号"
Height = 255
Index = 3
Left = 3000
TabIndex = 15
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学生班号"
Height = 255
Index = 2
Left = 1560
TabIndex = 14
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试期号"
Height = 255
Index = 0
Left = 0
TabIndex = 13
Top = 0
Width = 1335
End
End
Begin VB.OptionButton Option1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "添 加"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 0
TabIndex = 10
Top = 0
Width = 855
End
Begin VB.OptionButton Option1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "查 询"
ForeColor = &H80000008&
Height = 255
Index = 1
Left = 840
TabIndex = 9
Top = 0
Width = 855
End
Begin VB.OptionButton Option1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "修 改"
ForeColor = &H80000008&
Height = 255
Index = 2
Left = 1680
TabIndex = 8
Top = 0
Width = 855
End
Begin VB.OptionButton Option1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "删 除"
ForeColor = &H80000008&
Height = 255
Index = 3
Left = 2520
TabIndex = 7
Top = 0
Width = 855
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
ForeColor = &H80000008&
Height = 1215
Index = 1
Left = 0
ScaleHeight = 1185
ScaleWidth = 8145
TabIndex = 1
Top = 4440
Width = 8175
Begin VB.ComboBox Combo2
Height = 300
Index = 2
Left = 4560
Style = 2 'Dropdown List
TabIndex = 48
Top = 360
Width = 1455
End
Begin VB.ComboBox Combo2
Height = 300
Index = 1
Left = 3000
Style = 2 'Dropdown List
TabIndex = 47
Top = 360
Width = 1455
End
Begin VB.ComboBox Combo2
Height = 300
Index = 0
Left = 1440
Style = 2 'Dropdown List
TabIndex = 46
Top = 360
Width = 1455
End
Begin VB.TextBox Text2
BackColor = &H8000000E&
Enabled = 0 'False
Height = 300
Index = 2
Left = 6600
MaxLength = 10
TabIndex = 40
Top = 360
Width = 1380
End
Begin VB.TextBox Text2
BackColor = &H8000000E&
Height = 300
Index = 1
Left = 0
MaxLength = 10
TabIndex = 29
Top = 360
Width = 1380
End
Begin VB.TextBox Text2
BackColor = &H8000000E&
Height = 300
Index = 0
Left = 0
MaxLength = 14
TabIndex = 27
Top = 720
Visible = 0 'False
Width = 1380
End
Begin CSCommand.Command Command3
Height = 375
Left = 4920
TabIndex = 57
Top = 720
Width = 1095
_ExtentX = 1931
_ExtentY = 661
IconAlign = 0
Icon = "frmcj1.frx":00A8
Caption = "查 询"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommand.Command Command4
Height = 375
Left = 6600
TabIndex = 58
Top = 720
Width = 1095
_ExtentX = 1931
_ExtentY = 661
IconAlign = 0
Icon = "frmcj1.frx":00C4
Caption = "取 消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试期号"
Height = 255
Index = 1
Left = 0
TabIndex = 6
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学生班号"
Height = 255
Index = 6
Left = 1560
TabIndex = 5
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学生编号"
Height = 255
Index = 7
Left = 3240
TabIndex = 4
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试课程"
Height = 255
Index = 8
Left = 4920
TabIndex = 3
Top = 0
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "考试分数"
Height = 255
Index = 9
Left = 6600
TabIndex = 2
Top = 0
Width = 1335
End
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 4890
Left = 0
TabIndex = 0
Top = 840
Width = 8175
_ExtentX = 14420
_ExtentY = 8625
_Version = 393216
Cols = 4
FixedCols = 0
BackColorFixed = 14737632
BackColorBkg = -2147483643
Appearance = 0
End
Begin VB.Label Label2
BackColor = &H00E0E0E0&
Caption = "查询中 请稍后..."
Height = 255
Left = 0
TabIndex = 11
Top = 0
Width = 1575
End
End
Attribute VB_Name = "frmcj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_COLSE = &HF060
Dim mrc As ADODB.Recordset
Private Sub Combo1_Click(Index As Integer)
Dim txSQL As String
If Index = 0 Then
txSQL = "select * from student where class='" & Trim(Combo1(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = True Then
MsgBox "请先进行班级设置!", vbOKOnly, "提示"
Else
With Combo1(1)
.Clear
Do While Not mrc.EOF
.AddItem Trim(mrc!serial)
mrc.MoveNext
Loop
End With
End If
txSQL = "select * from class where name='" & Trim(Combo1(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = True Then
MsgBox "请先进行班级设置!", vbOKOnly, "提示"
Else
With Combo1(2)
.Clear
Do While Not mrc.EOF
.AddItem Trim(mrc!dept_id)
mrc.MoveNext
Loop
End With
End If
End If
End Sub
Private Sub Combo2_Click(Index As Integer)
Dim txSQL As String
If Index = 0 Then
txSQL = "select DISTINCT 班级 from cj where 年级='" & Trim(Combo2(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = False Then
With Combo2(1)
.Clear
Do While Not mrc.EOF
.AddItem Trim(mrc!班级)
mrc.MoveNext
Loop
End With
End If
txSQL = "select DISTINCT 课程名称 from cj where 年级='" & Trim(Combo2(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = False Then
With Combo2(2)
.Clear
Do While Not mrc.EOF
.AddItem Trim(mrc!课程名称)
mrc.MoveNext
Loop
End With
End If
End If
End Sub
Private Sub Combo3_Click(Index As Integer)
Dim txSQL As String
If Index = 0 Then
txSQL = "select * from student where class='" & Trim(Combo3(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = False Then
With Combo3(1)
.Clear
Do While Not mrc.EOF
If mrc!student_NO <> .Text Then
.AddItem Trim(mrc!serial)
End If
mrc.MoveNext
Loop
End With
End If
txSQL = "select * from class where name='" & Trim(Combo3(0).Text) & "'"
Set mrc = ExecuteSQL(txSQL)
If mrc.EOF = False Then
With Combo3(2)
.Clear
Do While Not mrc.EOF
If mrc!course_Name <> .Text Then
.AddItem Trim(mrc!dept_id)
End If
mrc.MoveNext
Loop
End With
End If
End If
End Sub
Private Sub Command1_Click()
Dim txtSQL As String
If Text1(1) = "" Then
MsgBox "考试期号不能为空!", vbOKOnly, "提示"
Text1(1).SetFocus
Exit Sub
End If
If Combo1(0).Text = "" Then
MsgBox "学生班号不能为空!", vbOKOnly, "提示"
Combo1(0).SetFocus
Exit Sub
End If
If Combo1(1).Text = "" Then
MsgBox "学生编号不能为空!", vbOKOnly, "提示"
Combo1(1).SetFocus
Exit Sub
End If
If Combo1(2).Text = "" Then
MsgBox "考试课程不能为空!", vbOKOnly, "提示"
Combo1(2).SetFocus
Exit Sub
End If
If Text1(2) = "" Then
MsgBox "考试分数不能为空!", vbOKOnly, "提示"
Text1(2).SetFocus
Exit Sub
End If
txtSQL = "select * from cj where 学期='" & Trim(Text1(1)) & "' and 年级='" & Trim(Combo1(0).Text) & "' and 班级='" & Trim(Combo1(1).Text) & "'And 课程名称='" & Trim(Combo1(2).Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = False Then
MsgBox "同次同人同科只能添加一次", vbOKOnly, "警告"
Text1(2) = ""
Combo1(0).SetFocus
Exit Sub
End If
txtSQL = "select * from cj"
Set mrc = ExecuteSQL(txtSQL)
mrc.AddNew
mrc.Fields(0) = Trim(Text1(0))
mrc.Fields(1) = Trim(Text1(1))
mrc.Fields(2) = Trim(Combo1(0).Text)
mrc.Fields(3) = Trim(Combo1(1).Text)
mrc.Fields(4) = Trim(Combo1(2).Text)
mrc.Fields(5) = Trim(Text1(2))
mrc.Update
mrc.Close
MsgBox "考试信息添加成功!", vbOKOnly, "提示"
With MSFlexGrid1
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = Trim(Text1(0))
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?