📄 lentfrm.frm
字号:
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "借出日期"
ForeColor = &H00000000&
Height = 180
Index = 1
Left = 240
TabIndex = 18
Top = 2160
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "类别"
ForeColor = &H00000000&
Height = 180
Index = 0
Left = 4920
TabIndex = 16
Top = 360
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "今天日期"
ForeColor = &H00000000&
Height = 180
Index = 9
Left = 2520
TabIndex = 12
Top = 2160
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "出版社"
ForeColor = &H00000000&
Height = 180
Index = 10
Left = 240
TabIndex = 11
Top = 1560
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "价格"
ForeColor = &H00000000&
Height = 180
Index = 11
Left = 3000
TabIndex = 10
Top = 360
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "书 名"
ForeColor = &H00000000&
Height = 180
Index = 12
Left = 240
TabIndex = 9
Top = 960
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "图书编号"
ForeColor = &H00000000&
Height = 180
Index = 13
Left = 240
TabIndex = 8
Top = 360
Width = 720
End
End
Begin VB.CommandButton cmdOkCancel
Caption = "归还图书(&C)"
Height = 495
Index = 1
Left = 5640
Style = 1 'Graphical
TabIndex = 1
ToolTipText = "归还当前图书"
Top = 5280
Visible = 0 'False
Width = 1695
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "输入要还的图书编号"
ForeColor = &H00FF0000&
Height = 180
Index = 1
Left = 360
TabIndex = 15
Top = 720
Width = 1620
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Enter"
ForeColor = &H000000FF&
Height = 180
Index = 3
Left = 4920
TabIndex = 14
Top = 720
Width = 450
End
Begin VB.Line Line2
BorderColor = &H8000000D&
Index = 1
X1 = 0
X2 = 7440
Y1 = 1320
Y2 = 1320
End
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
MsgBox "还书成功!按回车继续", 0 + 48, "完毕"
End Select
End Sub
Private Sub Form_Load()
Set db2 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst2 = db2.OpenRecordset("BookFf", dbOpenTable)
rst2.Index = "图书编号"
Set db3 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst3 = db3.OpenRecordset("Book", dbOpenTable)
rst3.Index = "图书编号"
Set db1 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst1 = db1.OpenRecordset("Personal", dbOpenTable)
rst1.Index = "借书证号"
Set db = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.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
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 = DateTime.Date
txtType1.Text = rst3.Fields("类别") & vbNullString
txtLentDay.Text = DateTime.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 = FaCost * Val(txtChaoChu.Text) 'Format(aa, ".00")' " #.00") '计算余额
End If
End Sub
Private Sub txtChaoChu_Change()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -