📄 frmback.frm
字号:
VERSION 5.00
Begin VB.Form frmBack
Caption = "录像归还"
ClientHeight = 3120
ClientLeft = 60
ClientTop = 450
ClientWidth = 5220
LinkTopic = "Form1"
ScaleHeight = 3120
ScaleWidth = 5220
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtDisk
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 2
Top = 480
Width = 2535
End
Begin VB.CommandButton cmdSub
Caption = "确 定"
Height = 495
Left = 600
TabIndex = 1
Top = 1680
Width = 1335
End
Begin VB.CommandButton cmdBack
Caption = "返 回"
Height = 495
Left = 2760
TabIndex = 0
Top = 1680
Width = 1335
End
Begin VB.Label Label1
Caption = "录像编号:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 3
Top = 480
Width = 1215
End
End
Attribute VB_Name = "frmBack"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBack_Click()
Unload Me
frmAdmin.Show
End Sub
Private Sub cmdDelete_Click()
txtDisk.Text = ""
End Sub
Private Sub cmdSub_Click()
If txtDisk.Text = "" Then
MsgBox "对不起,请输入录像编号!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
Set db2 = OpenDatabase("Haiyu.mdb")
Set rs2 = db2.OpenRecordset("SELECT * FROM EDisk")
Set db3 = OpenDatabase("Haiyu.mdb")
Set rs3 = db3.OpenRecordset("SELECT * FROM Disk")
rs2.MoveFirst
Do Until rs2.EOF
If rs2!录像编号 = txtDisk.Text Then
Exit Do
Else
rs2.MoveNext
End If
Loop
If rs2.EOF Then
MsgBox "对不起,该录像编号不存在,请重新输入!", vbOKOnly + vbExclamation, "错误"
txtDisk.Text = ""
txtDisk.SetFocus
Exit Sub
End If
Do Until rs3.EOF
If rs2!分类编号 = rs3!分类编号 Then
Exit Do
Else
rs3.MoveNext
End If
Loop
temp = rs3!库存数量
With rs2
.Edit
!是否借出 = False
.Update
End With
With rs3
.Edit
!库存数量 = temp + 1
.Update
End With
Dim money As Double
Dim time As Integer
time = Date - rs2!租借日期
If time = 0 Then
time = 1
End If
Select Case rs3!收费标准
Case "CD"
money = time * 1
Case "VCD"
money = time * 0.5
Case "DVD"
money = time * 1.5
Case "DVCD"
money = time * 1
Case Else
money = time * 0.5
End Select
MsgBox "该录像已经归还成功! 租借时间为" & time & "天,租金为" & money & "元!", vbOKOnly + vbExclamation, "成功"
txtDisk.Text = ""
txtDisk.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -