📄 lentfrm.frm
字号:
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 2
Left = 240
TabIndex = 17
Top = 2760
Width = 840
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "修改日期"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 1
Left = 240
TabIndex = 15
Top = 2160
Width = 840
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 0
Left = 4920
TabIndex = 13
Top = 360
Width = 420
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "今天日期"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 9
Left = 2520
TabIndex = 12
Top = 2160
Width = 840
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "描 述"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 10
Left = 240
TabIndex = 11
Top = 1560
Width = 630
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "时间"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 11
Left = 3000
TabIndex = 10
Top = 360
Width = 420
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "名 称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 12
Left = 240
TabIndex = 9
Top = 960
Width = 630
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "信息编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 13
Left = 240
TabIndex = 8
Top = 360
Width = 840
End
End
Begin VB.CommandButton cmdOkCancel
BackColor = &H00FFFFFF&
Caption = "返回信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 5640
Style = 1 'Graphical
TabIndex = 1
ToolTipText = "归还当前图书"
Top = 4110
Visible = 0 'False
Width = 1695
End
End
Begin VB.Image Image1
Height = 480
Left = 60
Picture = "Lentfrm.frx":09CC
Top = 60
Width = 480
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "**<查询信息只许单步进行>"
ForeColor = &H00800000&
Height = 180
Index = 3
Left = 2805
TabIndex = 28
Top = 735
Width = 2160
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "输入要返回的信息编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 210
Index = 1
Left = 600
TabIndex = 27
Top = 165
Width = 2100
End
Begin VB.Shape Shape1
BackColor = &H00D0D0D0&
BackStyle = 1 'Opaque
BorderStyle = 0 'Transparent
Height = 1245
Left = -15
Top = -30
Width = 7710
End
End
Attribute VB_Name = "Lentfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst2 As Recordset '打开表BookFlag
Dim rst3 As Recordset '打开表Book
Dim rst1 As Recordset '打开表personal
Dim db2 As Database
Dim db3 As Database
Dim db1 As Database
Dim db As Database
Dim rst As Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOkCancel_Click(Index As Integer)
Select Case Index
Case 1
rst2.Seek "=", txtBookBian1.Text
If rst2.NoMatch Then
MsgBox "没有修改过这条纪录!是不是编号错了?", 0 + 48, "提示"
txtBookBian1.Text = ""
txtBookBian1.SetFocus
Frame6.Visible = False
cmdOkCancel(1).Visible = False
Exit Sub
End If
If rst3.Fields("是否修改") = False Then
MsgBox "内容还没有修改过!", 0 + 48, "提示"
Exit Sub
End If
rst1.Seek "=", rst2.Fields("查询证号")
rst1.Edit
'将罚款金额写入数据库
rst1.Fields("罚款") = Val(txtFa.Text) + rst1.Fields("罚款")
rst1.Update
If txtFa.Text > 0 Then
MsgBox "罚款金额已经写入数据库!", 0 + 48, "提示"
End If
rst2.Delete
rst3.Edit
rst3.Fields("是否修改") = False
rst3.Fields("修改日期") = Empty
rst3.Update
txtBookBian1.Text = ""
txtBookBian1.SetFocus
Frame6.Visible = False
cmdOkCancel(1).Visible = False
Me.Height = 1545
' MsgBox "还书完毕!按回车继续", 0 + 48, "完毕"
End Select
End Sub
Private Sub Form_Load()
Set db2 = Workspaces(0).OpenDatabase(App.Path & "\Database\Data.mdb", False)
Set rst2 = db2.OpenRecordset("BookFf", dbOpenTable)
rst2.Index = "信息编号"
Set db3 = Workspaces(0).OpenDatabase(App.Path & "\Database\Data.mdb", False)
Set rst3 = db3.OpenRecordset("Book", dbOpenTable)
rst3.Index = "信息编号"
Set db1 = Workspaces(0).OpenDatabase(App.Path & "\Database\Data.mdb", False)
Set rst1 = db1.OpenRecordset("Personal", dbOpenTable)
rst1.Index = "查询证号"
Set db = Workspaces(0).OpenDatabase(App.Path & "\Database\Data.mdb", False)
Set rst = db.OpenRecordset("Type", dbOpenTable)
rst.Index = "类别"
txtBookBian1.Text = ""
txtBookhao1.Text = ""
txtBookname1.Text = ""
txtCost1 = ""
txtChuban1 = ""
txtLentDate1 = ""
txtToday = ""
txtType1 = ""
txtLentDay = ""
txtXianDing.Text = ""
txtChaoChu.Text = ""
txtFa.Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
rst2.Close
rst3.Close
rst1.Close
db1.Close
db2.Close
db3.Close
End Sub
Private Sub txtBookBian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
rst3.Seek "=", txtBookBian1.Text
If rst3.NoMatch Then
MsgBox "没有此编号,请重新填写", 0 + 48, "填写错误"
txtBookBian1.Text = ""
'txtBookBian1.SelLength
txtBookBian1.SetFocus
Exit Sub
Else
Me.Height = 6360
End If
Frame6.Visible = True
cmdOkCancel(1).Visible = True
txtBookhao1.Text = txtBookBian1.Text
txtBookname1.Text = rst3.Fields("名称") & vbNullString
txtChuban1.Text = rst3.Fields("描述") & vbNullString
txtCost1.Text = rst3.Fields("值") & Empty
txtLentDate1 = rst3.Fields("修改日期") & Empty
txtToday.Text = Date
txtType1.Text = rst3.Fields("类别") & vbNullString
txtLentDay.Text = Date - rst3.Fields("修改日期") & Empty
rst.Seek "=", rst3.Fields("类别")
BookDay = rst.Fields("借出天数")
txtXianDing.Text = BookDay 'BookDay 为限定借出的天数
If Val(txtLentDay.Text) - BookDay <= 0 Then '判断是否超出了天数
txtChaoChu.Text = "未超出"
txtFa.Text = "0"
Exit Sub
Else
txtChaoChu.Text = Val(txtLentDay.Text) - BookDay
End If
txtFa.Text = Format(FaCost * Val(txtChaoChu.Text), "#.00") '计算余额
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -