📄 frmlent.frm
字号:
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2880
TabIndex = 12
Top = 3120
Width = 960
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "今天日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2880
TabIndex = 11
Top = 2400
Width = 960
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "借出天数"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 10
Top = 3120
Width = 960
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "借出日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 9
Top = 2400
Width = 960
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "出 版 社"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 8
Top = 1680
Width = 960
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "书 名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 7
Top = 1080
Width = 960
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "类别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 5400
TabIndex = 6
Top = 480
Width = 480
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "价格"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 3240
TabIndex = 5
Top = 480
Width = 480
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "书籍编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 4
Top = 480
Width = 960
End
End
Begin VB.Frame Frame1
Caption = "输入要还书的编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00004080&
Height = 1335
Left = 240
TabIndex = 0
Top = 240
Width = 7935
Begin VB.TextBox Text1
Height = 375
Left = 2280
TabIndex = 1
Text = "Text1"
Top = 600
Width = 3495
End
Begin VB.Label Label16
BackColor = &H00808080&
Caption = "Label16"
Height = 375
Left = 2340
TabIndex = 31
Top = 660
Width = 3495
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "书籍编号"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 1080
TabIndex = 26
Top = 600
Width = 1140
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Enter"
ForeColor = &H000000FF&
Height = 180
Left = 6120
TabIndex = 2
Top = 960
Width = 450
End
Begin VB.Image Image1
Height = 480
Left = 6000
Picture = "frmLent.frx":0442
Top = 480
Width = 480
End
End
Begin VB.Label Label28
BackColor = &H00808080&
Caption = "Label28"
Height = 495
Left = 6540
TabIndex = 43
Top = 6180
Width = 1695
End
End
Attribute VB_Name = "frmLent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim strSQL As String
If Text2.Text = "" Then Exit Sub
strSQL = "Delete From 借阅信息 "
strSQL = strSQL + "Where 借书证号='" + frmMain.Text1.Text + "'"
strSQL = strSQL + " And 书籍编号='" + Text2.Text + "'"
ADOcn.Execute strSQL
strSQL = "Update 书籍信息 "
strSQL = strSQL + "Set 是否被借出='" + "否" + "'"
strSQL = strSQL + " Where 书籍编号='" + Text2.Text + "'"
ADOcn.Execute strSQL
Call mbdOpen("读者信息", "借书证号", frmMain.Text1.Text)
strSQL = "Update 读者信息 "
strSQL = strSQL + "Set 已借书数量='" + Str(Val(mbdGet("已借书数量")) - 1) + "'"
strSQL = strSQL + " Where 借书证号='" + frmMain.Text1.Text + "'"
ADOcn.Execute strSQL
Call mbdClose
Unload Me
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call cmdMouseDown(Command1)
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.BackColor = &H8000000D
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call cmdMouseUp(Command1)
End Sub
Private Sub Form_Activate()
Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "": Text5.Text = ""
Text6.Text = "": Text7.Text = "": Text8.Text = ""
Text9.Text = "": Text10.Text = "": Text11.Text = "": Text12.Text = ""
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.BackColor = &H8000000F
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim ins As Integer, ins1 As Integer
Dim huan As String
Dim ADOrs As New Recordset
ADOrs.ActiveConnection = ADOcn
On Error GoTo xx:
If KeyAscii = 13 Then
ADOrs.Open "Select 借阅信息.借书证号,借阅信息.书籍编号,书籍信息.价格,书籍信息.书籍类别,书籍信息.书籍名称,书籍信息.出版社,借阅信息.出借日期,借阅信息.还书日期,读者类别.借书期限,读者类别.罚金计算 From 借阅信息,书籍信息,读者类别 Where 借阅信息.借书证号='" + frmMain.Text1.Text + "' And 借阅信息.书籍编号='" + Text1.Text + "'"
Text2.Text = ADOrs("书籍编号")
Text3.Text = ADOrs("价格")
Text4.Text = ADOrs("书籍类别")
Text5.Text = ADOrs("书籍名称")
Text6.Text = ADOrs("出版社")
Text7.Text = ADOrs("出借日期")
huan = ADOrs("还书日期")
Text8.Text = Format(Now, "yyyy-mm-dd")
Text9.Text = ADOrs("借书期限")
Text12.Text = ADOrs("罚金计算")
ins = InStr(huan, "-")
ins1 = InStr(6, huan, "-")
Text10.Text = DateDiff("d", DateSerial(Int(Left(Text7.Text, 4)), Int(Mid(Text7.Text, ins + 1, ins1 - ins - 1)), Int(Right(Text7.Text, Len(Text7.Text) - ins1))), Now)
If Val(DateDiff("d", DateSerial(Int(Left(huan, 4)), Int(Mid(huan, ins + 1, ins1 - ins - 1)), Int(Right(huan, Len(huan) - ins1))), Now)) >= 0 Then
Text11.Text = DateDiff("d", DateSerial(Int(Left(huan, 4)), Int(Mid(huan, ins + 1, ins1 - ins - 1)), Int(Right(huan, Len(huan) - ins1))), Now)
Text12.Text = Int(Val(Text12.Text) * Val(DateDiff("d", DateSerial(Int(Left(huan, 4)), Int(Mid(huan, ins + 1, ins1 - ins - 1)), Int(Right(huan, Len(huan) - ins1))), Now)) * 100 + 0.5) / 100
Else
Text11.Text = "0": Text12.Text = "0.00"
End If
Exit Sub
xx:
Call Form_Activate
MsgBox "请输入正确的【书籍编号】"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -