?? form4.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form4
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "查詢(xún)"
ClientHeight = 2970
ClientLeft = 45
ClientTop = 330
ClientWidth = 4530
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2970
ScaleWidth = 4530
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 3
Left = 1920
TabIndex = 9
Top = 2040
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 2
Left = 1920
TabIndex = 8
Top = 1560
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 1
Left = 1920
TabIndex = 7
Top = 1080
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 255
Left = 2880
TabIndex = 6
Top = 2520
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 255
Left = 600
TabIndex = 5
Top = 2520
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 0
Left = 1920
TabIndex = 0
Text = " "
Top = 600
Width = 975
End
Begin VB.Label Label5
Caption = "按姓名關(guān)鍵字查詢(xún):"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 0
TabIndex = 10
Top = 2040
Width = 2775
End
Begin VB.Label Label3
Caption = "學(xué)生檔案查詢(xún)"
BeginProperty Font
Name = "楷體_GB2312"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 4
Top = 0
Width = 2175
End
Begin VB.Label Label1
Caption = "學(xué)號(hào):"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 1200
TabIndex = 3
Top = 600
Width = 975
End
Begin VB.Label Label2
Caption = "姓名:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 1200
TabIndex = 2
Top = 1080
Width = 1455
End
Begin VB.Label Label4
Caption = "班級(jí):"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 1200
TabIndex = 1
Top = 1560
Width = 1575
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Private Sub Command1_Click()
Dim aa As Integer
txtsql = ""
If Trim(Text1(0).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.學(xué)號(hào)='" & Trim(Text1(0).Text) & "'"
Else
txtsql = txtsql & "and xj.學(xué)號(hào)='" & Trim(Text1(0).Text) & "'"
End If
End If
If Trim(Text1(1).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.姓名='" & Trim(Text1(1).Text) & "'"
Else
txtsql = txtsql & "and xj.姓名='" & Trim(Text1(1).Text) & "'"
End If
End If
If Trim(Text1(2).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.班級(jí)='" & Trim(Text1(2).Text) & "'"
Else
txtsql = txtsql & "and xj.班級(jí)='" & Trim(Text1(2).Text) & "'"
End If
End If
If Trim(Text1(3).Text) <> "" Then
aa = 1
txtsql = ""
txtsql = "xj.姓名 like '%" & Trim(Text1(3).Text) & "%'"
End If
If aa = 0 Then
ss = MsgBox("你至少要輸入一個(gè)條件以上才能查詢(xún)!", , " 警告")
Text1(0).SetFocus
Exit Sub
End If
Dim str As String
str = "select * from xj where " & txtsql
Dim mrc As ADODB.Recordset
Set mrc = ExecuteSQL(str)
If mrc.EOF = True Then
zzz = MsgBox("對(duì)不起,沒(méi)有此學(xué)生的檔案記錄!", vbOKOnly, "查詢(xún)")
Form4.ZOrder (0)
Form4.Text1(0).SetFocus
Exit Sub
End If
txtsql = "select xj.學(xué)號(hào),xj.姓名,xj.性別,class.年級(jí),xj.班級(jí),class.專(zhuān)業(yè),class.年制," & _
" xj.出生年月,xj.家庭住址,xj.郵政編碼,xj.聯(lián)系電話,xj.入學(xué)時(shí)間,xj.備注 " & _
" from xj inner join class on xj.班級(jí)=class.班級(jí) where " & txtsql & _
"order by class.年級(jí) desc,class.班級(jí) desc,xj.學(xué)號(hào) desc"
Form3.printstr = txtsql
find = True
Form3.Show
Form3.Caption = "學(xué)生檔案查詢(xún)結(jié)果"
Form3.showtitle
Form3.showdata
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
find = True
End Sub
Private Sub Form_LostFocus()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
find = False
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
End If
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -