📄 frmsrchissue.frm
字号:
VERSION 5.00
Begin VB.Form frmSrchIssue
Caption = "外借图书查询"
ClientHeight = 5640
ClientLeft = 120
ClientTop = 420
ClientWidth = 6840
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 5640
ScaleWidth = 6840
WindowState = 2 'Maximized
Begin VB.CommandButton cmdMemberOpen
Caption = "..."
Height = 255
Left = 4320
TabIndex = 12
Top = 2640
Width = 975
End
Begin VB.TextBox txtFineAmt
Height = 495
Left = 2520
TabIndex = 11
Text = "Text1"
Top = 4080
Width = 1815
End
Begin VB.TextBox txtDaysUsed
Height = 495
Left = 2520
TabIndex = 9
Text = "Text1"
Top = 3280
Width = 1815
End
Begin VB.TextBox txtLibraryId
Height = 495
Left = 2520
TabIndex = 7
Text = "Text1"
Top = 2480
Width = 1815
End
Begin VB.TextBox txtIssueDate
Height = 495
Left = 2520
TabIndex = 4
Text = "Text1"
Top = 1680
Width = 1815
End
Begin VB.Frame Frame1
Caption = "输入图书编号后回车"
Height = 975
Left = 360
TabIndex = 0
Top = 360
Width = 5535
Begin VB.CommandButton cmdBookOpen
Caption = "..."
Height = 255
Left = 4080
TabIndex = 3
Top = 480
Width = 855
End
Begin VB.TextBox txtBookId
Height = 495
Left = 2160
TabIndex = 2
Text = "Text1"
Top = 360
Width = 1815
End
Begin VB.Label Label1
Caption = "图书编号"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 1
Top = 360
Width = 1335
End
End
Begin VB.Label Label5
Caption = "罚款金额"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 10
Top = 4080
Width = 1695
End
Begin VB.Label Label4
Caption = "用户使用天数"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 8
Top = 3360
Width = 1815
End
Begin VB.Label Label3
Caption = "图书馆编号"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 6
Top = 2520
Width = 1455
End
Begin VB.Label Label2
Caption = "借书日期"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 480
TabIndex = 5
Top = 1680
Width = 1335
End
End
Attribute VB_Name = "frmSrchIssue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
Dim BookNo As String
Dim issueDate As Date
Dim currDate As Date
Dim totalDaysUsed As Integer
Dim totalFineAmt As Integer
'获取图书编号
BookNo = txtBookId.Text
'若用户按回车键,则自动产生记录
If KeyAscii = 13 Then
clear
If Not IsNumeric(BookNo) Then
MsgBox "Invalid search key entered", vbCritical, "Search error"
Call clear
Exit Sub
End If
rsIssueInfo.MoveFirst
For i = 0 To rsIssueInfo.RecordCount
If rsIssueInfo.EOF = True Then
Exit For
End If
'返回相关图书信息
If rsIssueInfo(0) = Val(Trim$(BookNo)) Then
txtLibraryId.Text = rsIssueInfo(2)
txtReturnDate.Text = Format(Now, "mm/dd/yy") '获取当前日期
txtIssueDate.Text = rsIssueInfo(1)
issueDate = CDate(txtIssueDate.Text)
currDate = CDate(Format(Now, "mm/dd/yy"))
totalDaysUsed = DateDiff("d", issueDate, currDate)
If totalDaysUsed > maxDays Then '判断学生还书是否过期
txtFineAmt.Visible = True
lblFineAmt.Visible = True
totalDaysUsed = totalDaysUsed - maxDays
totalFineAmt = fineAmt * totalDaysUsed
txtDaysUsed.ForeColor = vbRed
txtFineAmt.ForeColor = vbRed
txtDaysUsed.Text = totalDaysUsed & "Days Beyond Limit"
txtFineAmt.Text = "$" & totalFineAmt '返回总天数
Else
txtDaysUsed.ForeColor = vbBlack
txtFineAmt.Visible = False
lblFineAmt.Visible = False
txtDaysUsed.Text = totalDaysUsed
End If
Exit For
End If
rsIssueInfo.MoveNext
Next
If txtLibraryId.Text = "" Then
MsgBox "Book Not Issued", vbInformation, "Search Not Found"
'cmdSave.Enabled = False
clear
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -