📄 searchstudent.frm
字号:
TabIndex = 7
Top = 480
Width = 1095
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "专 业:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 6
Left = 240
TabIndex = 25
Top = 1560
Width = 705
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 0
Left = 240
TabIndex = 13
Top = 480
Width = 705
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "挂失否:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 5
Left = 1920
TabIndex = 6
Top = 2760
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "班 级:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 1
Left = 240
TabIndex = 5
Top = 2160
Width = 705
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "性 别:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 3
Left = 240
TabIndex = 4
Top = 960
Width = 705
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "已借书数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400040&
Height = 210
Index = 4
Left = 240
TabIndex = 3
Top = 2760
Width = 1035
End
End
Begin VB.Data lenddata
Caption = "lenddata"
Connect = "Access"
DatabaseName = "db2.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 3120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "lend"
Top = 4920
Visible = 0 'False
Width = 2100
End
Begin VB.Data studentdata
Caption = "studentdata"
Connect = "Access"
DatabaseName = "db2.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 480
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "student"
Top = 4920
Visible = 0 'False
Width = 2340
End
Begin VB.Label Label3
Height = 615
Index = 2
Left = 3120
TabIndex = 1
Top = 2280
Width = 855
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "读者资料查询"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 315
Left = 4560
TabIndex = 15
Top = 0
Width = 1995
End
End
Attribute VB_Name = "searchstudent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text6.Text = "" Then
MsgBox "卡号不能为空!"
Else
studentdata.Recordset.MoveFirst
condition = "卡号='" & Text6.Text & "'"
studentdata.Recordset.FindFirst condition
If studentdata.Recordset.NoMatch Then
MsgBox "该卡号不存在!"
Else
Text2.Text = studentdata.Recordset.Fields("姓名")
Text3.Text = studentdata.Recordset.Fields("班级")
Text4.Text = studentdata.Recordset.Fields("已借书数")
Text5.Text = studentdata.Recordset.Fields("挂失否")
Text1.Text = studentdata.Recordset.Fields("专业")
Command3.Enabled = True
'Command1.Enabled = False
If studentdata.Recordset.Fields("性别") = "男" Then
Option1.Value = True
Else
Option2.Value = True
End If
lenddata.Recordset.MoveFirst
bookdata.Recordset.MoveFirst
Do
If InStr(lenddata.Recordset.Fields("卡号"), Text6.Text) Then
List1.AddItem " " & lenddata.Recordset.Fields("书号") & " " & bookdata.Recordset.Fields("书名") & " " & lenddata.Recordset.Fields("借书日期") & " " & lenddata.Recordset.Fields("期限日期")
End If
lenddata.Recordset.MoveNext
bookdata.Recordset.MoveNext
Loop Until lenddata.Recordset.EOF
End If
End If
End Sub
Private Sub Command2_Click()
Unload searchstudent
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text6.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Option1.Value = False
Option2.Value = False
List1.Clear
Command1.Enabled = True
Command3.Enabled = False
End Sub
Private Sub Form_Load()
Option1.Value = False
Option2.Value = False
End Sub
Private Sub Text6_LostFocus()
Command1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -