📄 frmclassfind.frm
字号:
VERSION 5.00
Begin VB.Form frmClassFind
BorderStyle = 1 'Fixed Single
Caption = "班级查询"
ClientHeight = 2370
ClientLeft = 45
ClientTop = 330
ClientWidth = 3270
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2370
ScaleWidth = 3270
Begin VB.TextBox txtClass
BackColor = &H80000018&
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Index = 0
Left = 960
TabIndex = 3
Top = 300
Width = 1935
End
Begin VB.CommandButton cmdOK
Caption = "确定"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 1800
Width = 1095
End
Begin VB.TextBox txtClass
BackColor = &H80000018&
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Index = 1
Left = 960
TabIndex = 1
Top = 840
Width = 1935
End
Begin VB.TextBox txtClass
BackColor = &H80000018&
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Index = 2
Left = 960
TabIndex = 0
Top = 1320
Width = 1935
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "专业:"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 225
Left = 360
TabIndex = 6
Top = 1320
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "班级:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 5
Top = 840
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "年级:"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 225
Left = 360
TabIndex = 4
Top = 360
Width = 540
End
End
Attribute VB_Name = "frmClassFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'----------------------------------frmClassFind.frm----------------------------------
Option Explicit
Private Sub cmdOK_Click()
Dim objRecordset As ADODB.Recordset
strSQL = ""
'判断查询输入条件的合法性
If txtClass(0).Text <> "" Then
If strSQL = "" Then
strSQL = "年级='" & Trim(txtClass(0).Text) & "'"
Else
strSQL = strSQL & "and 年级='" & Trim(txtClass(0).Text) & "'"
End If
End If
If txtClass(1).Text <> "" Then
If strSQL = "" Then
strSQL = "班级='" & Trim(txtClass(1).Text) & "'"
Else
strSQL = strSQL & "and 班级='" & Trim(txtClass(1).Text) & "'"
End If
End If
If txtClass(2).Text <> "" Then
If strSQL = "" Then
strSQL = "专业='" & Trim(txtClass(2).Text) & "'"
Else
strSQL = strSQL & "and 专业='" & Trim(txtClass(2).Text) & "'"
End If
End If
If strSQL = "" Then
MsgBox "你至少要输入一个条件以上才能查询!", , " 警告"
txtClass(0).SetFocus
Exit Sub
End If
'查询符合条件的班级
strSQL = "select * from Classes where " & strSQL
Set objRecordset = ExecuteSQL(strSQL)
'如果没有查询符合条件的班级
If objRecordset.EOF = True Then
MsgBox "对不起,没有此班级的档案记录!", vbOKOnly, "查询"
frmClassFind.ZOrder (0)
frmClassFind.txtClass(0).SetFocus
Exit Sub
End If
' frmClassBrower.printstr = strSQL
blnFindClass = True
'返回班级浏览界面
frmClassBrower.Show
frmClassBrower.ShowClassTitle
frmClassBrower.ShowClassData
frmClassBrower.Caption = "班级设置查询结果"
frmClassBrower.ZOrder (0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
blnFindClass = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -